-
+ 0751215D7E2D5A2A14A694279BB8E3330D34F47ED49B4BA29605748C8BE9BF3808E8B6A63CC80BAA3EED0C4A14940AE380553B67DDB6BB04AA7223CD986E7C69
mp-wp/wp-admin/js/media-upload.js
(0 . 0)(1 . 62)
50477 // send html to the post editor
50478 function send_to_editor(h) {
50479 if ( typeof tinyMCE != 'undefined' && ( ed = tinyMCE.activeEditor ) && !ed.isHidden() ) {
50480 ed.focus();
50481 if (tinymce.isIE)
50482 ed.selection.moveToBookmark(tinymce.EditorManager.activeEditor.windowManager.bookmark);
50483
50484 if ( h.indexOf('[caption') === 0 ) {
50485 if ( ed.plugins.wpeditimage )
50486 h = ed.plugins.wpeditimage._do_shcode(h);
50487 } else if ( h.indexOf('[gallery') === 0 ) {
50488 if ( ed.plugins.wpgallery )
50489 h = ed.plugins.wpgallery._do_gallery(h);
50490 }
50491
50492 ed.execCommand('mceInsertContent', false, h);
50493
50494 } else if ( typeof edInsertContent == 'function' ) {
50495 edInsertContent(edCanvas, h);
50496 } else {
50497 jQuery( edCanvas ).val( jQuery( edCanvas ).val() + h );
50498 }
50499
50500 tb_remove();
50501 }
50502
50503 // thickbox settings
50504 jQuery(function($) {
50505 tb_position = function() {
50506 var tbWindow = $('#TB_window');
50507 var width = $(window).width();
50508 var H = $(window).height();
50509 var W = ( 720 < width ) ? 720 : width;
50510
50511 if ( tbWindow.size() ) {
50512 tbWindow.width( W - 50 ).height( H - 45 );
50513 $('#TB_iframeContent').width( W - 50 ).height( H - 75 );
50514 tbWindow.css({'margin-left': '-' + parseInt((( W - 50 ) / 2),10) + 'px'});
50515 if ( typeof document.body.style.maxWidth != 'undefined' )
50516 tbWindow.css({'top':'20px','margin-top':'0'});
50517 $('#TB_title').css({'background-color':'#222','color':'#cfcfcf'});
50518 };
50519
50520 return $('a.thickbox').each( function() {
50521 var href = $(this).attr('href');
50522 if ( ! href ) return;
50523 href = href.replace(/&width=[0-9]+/g, '');
50524 href = href.replace(/&height=[0-9]+/g, '');
50525 $(this).attr( 'href', href + '&width=' + ( W - 80 ) + '&height=' + ( H - 85 ) );
50526 });
50527 };
50528
50529 jQuery('a.thickbox').click(function(){
50530 if ( typeof tinyMCE != 'undefined' && tinyMCE.activeEditor ) {
50531 tinyMCE.get('content').focus();
50532 tinyMCE.activeEditor.windowManager.bookmark = tinyMCE.activeEditor.selection.getBookmark('simple');
50533 }
50534 });
50535
50536 $(window).resize( function() { tb_position() } );
50537 });
50538