Changeset 18799
- Timestamp:
- 09/28/2011 07:26:34 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/js/media-upload.dev.js
r18766 r18799 13 13 return false; 14 14 } 15 } 16 17 if ( !ed && mce && wpActiveEditor ) 18 ed = tinymce.get(wpActiveEditor); 15 } else { 16 if ( mce && tinymce.activeEditor && (tinymce.activeEditor.id == 'mce_fullscreen' || tinymce.activeEditor.id == 'wp_mce_fullscreen') ) 17 ed = tinymce.activeEditor; 18 else 19 ed = tinymce.get(wpActiveEditor); 20 } 19 21 20 22 if ( ed && !ed.isHidden() ) { -
trunk/wp-admin/js/media-upload.js
r18766 r18799 1 var wpActiveEditor;function send_to_editor(c){var b,a=typeof(tinymce)!="undefined",f=typeof(QTags)!="undefined";if(!wpActiveEditor){if(a&&tinymce.activeEditor){b=tinymce.activeEditor;wpActiveEditor=b.id}else{if(!f){return false}}} if(!b&&a&&wpActiveEditor){b=tinymce.get(wpActiveEditor)}if(b&&!b.isHidden()){if(tinymce.isIE&&b.windowManager.insertimagebookmark){b.selection.moveToBookmark(b.windowManager.insertimagebookmark)}if(c.indexOf("[caption")===0){if(b.plugins.wpeditimage){c=b.plugins.wpeditimage._do_shcode(c)}}else{if(c.indexOf("[gallery")===0){if(b.plugins.wpgallery){c=b.plugins.wpgallery._do_gallery(c)}}else{if(c.indexOf("[embed")===0){if(b.plugins.wordpress){c=b.plugins.wordpress._setEmbed(c)}}}}b.execCommand("mceInsertContent",false,c)}else{if(f){QTags.insertContent(c)}else{document.getElementById(wpActiveEditor).value+=c}}try{tb_remove()}catch(d){}}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);1 var wpActiveEditor;function send_to_editor(c){var b,a=typeof(tinymce)!="undefined",f=typeof(QTags)!="undefined";if(!wpActiveEditor){if(a&&tinymce.activeEditor){b=tinymce.activeEditor;wpActiveEditor=b.id}else{if(!f){return false}}}else{if(a&&tinymce.activeEditor&&(tinymce.activeEditor.id=="mce_fullscreen"||tinymce.activeEditor.id=="wp_mce_fullscreen")){b=tinymce.activeEditor}else{b=tinymce.get(wpActiveEditor)}}if(b&&!b.isHidden()){if(tinymce.isIE&&b.windowManager.insertimagebookmark){b.selection.moveToBookmark(b.windowManager.insertimagebookmark)}if(c.indexOf("[caption")===0){if(b.plugins.wpeditimage){c=b.plugins.wpeditimage._do_shcode(c)}}else{if(c.indexOf("[gallery")===0){if(b.plugins.wpgallery){c=b.plugins.wpgallery._do_gallery(c)}}else{if(c.indexOf("[embed")===0){if(b.plugins.wordpress){c=b.plugins.wordpress._setEmbed(c)}}}}b.execCommand("mceInsertContent",false,c)}else{if(f){QTags.insertContent(c)}else{document.getElementById(wpActiveEditor).value+=c}}try{tb_remove()}catch(d){}}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
r18766 r18799 26 26 var $this_tinymce = false; 27 27 var $this_quicktags = false; 28 var $has_tinymce = false; 29 var $has_quicktags = false; 30 var $has_medialib = false; 28 31 29 32 function __construct() { … … 68 71 if ( $this->this_quicktags && $this->this_tinymce ) { 69 72 $switch_class = 'html-active'; 73 $this->has_tinymce = $this->has_quicktags = true; 70 74 71 75 if ( 'html' == $this->default_editor ) { … … 78 82 $buttons .= '<a id="' . $editor_id . '-html" class="hide-if-no-js wp-switch-editor switch-html" onclick="switchEditors.go(this);return false;">' . __('HTML') . "</a>\n"; 79 83 $buttons .= '<a id="' . $editor_id . '-tmce" class="hide-if-no-js wp-switch-editor switch-tmce" onclick="switchEditors.go(this);return false;">' . __('Visual') . "</a>\n"; 84 } else { 85 if ( $this->this_tinymce ) 86 $this->has_tinymce = true; 87 88 if ( $this->this_quicktags ) 89 $this->has_quicktags = true; 80 90 } 81 91 … … 90 100 91 101 if ( $set['media_buttons'] ) { 102 $this->has_medialib = true; 103 92 104 if ( !function_exists('media_buttons') ) 93 105 include(ABSPATH . 'wp-admin/includes/media.php'); … … 443 455 wp_enqueue_style('editor-buttons'); 444 456 445 if ( $this-> this_tinymce )457 if ( $this->has_tinymce ) 446 458 wp_enqueue_script('editor'); 447 459 448 if ( $this-> this_quicktags )460 if ( $this->has_quicktags ) 449 461 wp_enqueue_script('quicktags'); 450 462 … … 458 470 wp_enqueue_script('wp-fullscreen'); 459 471 460 add_thickbox(); 461 wp_enqueue_script('media-upload'); 472 if ( $this->has_medialib ) { 473 add_thickbox(); 474 wp_enqueue_script('media-upload'); 475 } 462 476 } 463 477 … … 801 815 } 802 816 803 -
trunk/wp-includes/script-loader.php
r18798 r18799 277 277 $scripts->add( 'word-count', "/wp-admin/js/word-count$suffix.js", array( 'jquery' ), '20110515', 1 ); 278 278 279 $scripts->add( 'media-upload', "/wp-admin/js/media-upload$suffix.js", array( 'thickbox' ), '2011092 2', 1 );279 $scripts->add( 'media-upload', "/wp-admin/js/media-upload$suffix.js", array( 'thickbox' ), '20110927', 1 ); 280 280 281 281 if ( is_admin() ) {
Note: See TracChangeset
for help on using the changeset viewer.