Changeset 18516
- Timestamp:
- 08/06/2011 01:35:02 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/media.php
r18498 r18516 404 404 global $post_ID, $temp_ID; 405 405 $uploading_iframe_ID = (int) (0 == $post_ID ? $temp_ID : $post_ID); 406 $upload_iframe_src = add_query_arg( 'post_id', $uploading_iframe_ID, 'media-upload.php');406 $upload_iframe_src = add_query_arg( 'post_id', $uploading_iframe_ID, admin_url('media-upload.php') ); 407 407 408 408 if ( 'media' != $type ) -
trunk/wp-admin/js/media-upload.dev.js
r18498 r18516 1 1 // send html to the post editor 2 /* 2 3 var wpActiveEditor; 4 3 5 function send_to_editor(h) { 4 6 var ed; 5 7 6 if ( typeof tinyMCE != 'undefined' && ( ed = tinyMCE.activeEditor ) && !ed.isHidden() ) { 8 if ( !wpActiveEditor ) { 9 if ( typeof(tinymce) != 'undefined' && tinymce.activeEditor ) { 10 ed = tinymce.activeEditor; 11 wpActiveEditor = ed.id; 12 } else { 13 return false; 14 } 15 } 16 17 if ( !ed && typeof(tinymce) != 'undefined' && wpActiveEditor ) 18 ed = tinymce.get(wpActiveEditor); 19 20 if ( ed && !ed.isHidden() ) { 7 21 // restore caret position on IE 8 22 if ( tinymce.isIE && ed.windowManager.insertimagebookmark ) … … 21 35 22 36 ed.execCommand('mceInsertContent', false, h); 23 24 } else if ( typeof edInsertContent == 'function' ) { 25 edInsertContent(edCanvas, h); 37 } else if ( typeof(QTags) != 'undefined' ) { 38 QTags.insertContent(h); 26 39 } else { 27 jQuery( edCanvas ).val( jQuery( edCanvas ).val() + h );40 document.getElementById(wpActiveEditor).value += h; 28 41 } 29 42 30 43 tb_remove(); 31 44 } 32 */33 45 34 46 // thickbox settings … … 65 77 var ed; 66 78 67 if ( typeof tinyMCE != 'undefined' && tinymce.isIE && ( ed = tinyMCE.activeEditor) && !ed.isHidden() ) {79 if ( typeof(tinymce) != 'undefined' && tinymce.isIE && ( ed = tinymce.get(wpActiveEditor) ) && !ed.isHidden() ) { 68 80 ed.focus(); 69 81 ed.windowManager.insertimagebookmark = ed.selection.getBookmark(); -
trunk/wp-admin/js/media-upload.js
r18498 r18516 1 var tb_position;(function(a){tb_position=function(){var f=a("#TB_window"),e=a(window).width(),d=a(window).height(),c=(720<e)?720:e,b=0;if(a("body.admin-bar").length){b=28}if(f.size()){f.width(c-50).height(d-45-b);a("#TB_iframeContent").width(c-50).height(d-75-b);f.css({"margin-left":"-"+parseInt(((c-50)/2),10)+"px"});if(typeof document.body.style.maxWidth!="undefined"){f.css({top:20+b+"px","margin-top":"0"})}}return a("a.thickbox").each(function(){var g=a(this).attr("href");if(!g){return}g=g.replace(/&width=[0-9]+/g,"");g=g.replace(/&height=[0-9]+/g,"");a(this).attr("href",g+"&width="+(c-80)+"&height="+(d-85-b))})};a(window).resize(function(){tb_position()});a(document).ready(function(b){b("a.thickbox").click(function(){var c;if(typeof tinyMCE!="undefined"&&tinymce.isIE&&(c=tinyMCE.activeEditor)&&!c.isHidden()){c.focus();c.windowManager.insertimagebookmark=c.selection.getBookmark()}})})})(jQuery);1 var wpActiveEditor;function send_to_editor(b){var a;if(!wpActiveEditor){if(typeof(tinymce)!="undefined"&&tinymce.activeEditor){a=tinymce.activeEditor;wpActiveEditor=a.id}else{return false}}if(!a&&typeof(tinymce)!="undefined"&&wpActiveEditor){a=tinymce.get(wpActiveEditor)}if(a&&!a.isHidden()){if(tinymce.isIE&&a.windowManager.insertimagebookmark){a.selection.moveToBookmark(a.windowManager.insertimagebookmark)}if(b.indexOf("[caption")===0){if(a.plugins.wpeditimage){b=a.plugins.wpeditimage._do_shcode(b)}}else{if(b.indexOf("[gallery")===0){if(a.plugins.wpgallery){b=a.plugins.wpgallery._do_gallery(b)}}else{if(b.indexOf("[embed")===0){if(a.plugins.wordpress){b=a.plugins.wordpress._setEmbed(b)}}}}a.execCommand("mceInsertContent",false,b)}else{if(typeof(QTags)!="undefined"){QTags.insertContent(b)}else{document.getElementById(wpActiveEditor).value+=b}}tb_remove()}var tb_position;(function(a){tb_position=function(){var f=a("#TB_window"),e=a(window).width(),d=a(window).height(),c=(720<e)?720:e,b=0;if(a("body.admin-bar").length){b=28}if(f.size()){f.width(c-50).height(d-45-b);a("#TB_iframeContent").width(c-50).height(d-75-b);f.css({"margin-left":"-"+parseInt(((c-50)/2),10)+"px"});if(typeof document.body.style.maxWidth!="undefined"){f.css({top:20+b+"px","margin-top":"0"})}}return a("a.thickbox").each(function(){var g=a(this).attr("href");if(!g){return}g=g.replace(/&width=[0-9]+/g,"");g=g.replace(/&height=[0-9]+/g,"");a(this).attr("href",g+"&width="+(c-80)+"&height="+(d-85-b))})};a(window).resize(function(){tb_position()});a(document).ready(function(b){b("a.thickbox").click(function(){var c;if(typeof(tinymce)!="undefined"&&tinymce.isIE&&(c=tinymce.get(wpActiveEditor))&&!c.isHidden()){c.focus();c.windowManager.insertimagebookmark=c.selection.getBookmark()}})})})(jQuery); -
trunk/wp-includes/class-wp-editor.php
r18511 r18516 430 430 431 431 add_thickbox(); 432 wp_enqueue_script('media-upload'); 432 433 } 433 434 … … 526 527 527 528 if ( mce ) 528 try {tinymce.init(init);}catch(e){}529 try { tinymce.init(init); } catch(e){} 529 530 } 530 531 } … … 532 533 if ( typeof(QTags) == 'function' ) { 533 534 for ( qt in tinyMCEPreInit.qtInit ) { 534 try {quicktags(tinyMCEPreInit.qtInit[qt]);}catch(e){}535 try { quicktags( tinyMCEPreInit.qtInit[qt] ); } catch(e){} 535 536 } 536 537 } … … 539 540 var wpActiveEditor; 540 541 541 jQuery('.wp-editor-wrap'). click(function(e){542 jQuery('.wp-editor-wrap').mousedown(function(e){ 542 543 wpActiveEditor = this.id.slice(3, -5); 543 544 }); 544 545 545 function send_to_editor(h) {546 var ed;547 548 if ( typeof(tinymce) != 'undefined' && wpActiveEditor )549 ed = tinymce.get(wpActiveEditor);550 551 if ( ed && !ed.isHidden() ) {552 // restore caret position on IE553 if ( tinymce.isIE && ed.windowManager.insertimagebookmark )554 ed.selection.moveToBookmark(ed.windowManager.insertimagebookmark);555 556 if ( h.indexOf('[caption') === 0 ) {557 if ( ed.plugins.wpeditimage )558 h = ed.plugins.wpeditimage._do_shcode(h);559 } else if ( h.indexOf('[gallery') === 0 ) {560 if ( ed.plugins.wpgallery )561 h = ed.plugins.wpgallery._do_gallery(h);562 } else if ( h.indexOf('[embed') === 0 ) {563 if ( ed.plugins.wordpress )564 h = ed.plugins.wordpress._setEmbed(h);565 }566 567 ed.execCommand('mceInsertContent', false, h);568 } else if ( typeof quicktags != 'undefined' ) {569 QTags.insertContent(wpActiveEditor, h);570 } else {571 jQuery('#'+wpActiveEditor).val( jQuery('#'+wpActiveEditor).val() + h );572 }573 574 tb_remove();575 }576 546 <?php 577 547 -
trunk/wp-includes/script-loader.php
r18511 r18516 250 250 $scripts->add( 'word-count', "/wp-admin/js/word-count$suffix.js", array( 'jquery' ), '20110515', 1 ); 251 251 252 $scripts->add( 'media-upload', "/wp-admin/js/media-upload$suffix.js", array( 'thickbox' ), '20110 425', 1 );252 $scripts->add( 'media-upload', "/wp-admin/js/media-upload$suffix.js", array( 'thickbox' ), '20110805', 1 ); 253 253 254 254 if ( is_admin() ) {
Note: See TracChangeset
for help on using the changeset viewer.