summaryrefslogtreecommitdiffstats
path: root/wp-admin/js
diff options
context:
space:
mode:
authordonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2008-06-30 11:17:02 +0000
committerdonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2008-06-30 11:17:02 +0000
commit541e47c09b503df8bd9b6d149c82cb8d98ac2710 (patch)
tree94c90cfd4eee2b1035f886877b77f53d1f1717c8 /wp-admin/js
parent717b64911edf6baaa2aea29e13b8e808f088e660 (diff)
downloadwordpress-mu-541e47c09b503df8bd9b6d149c82cb8d98ac2710.tar.gz
wordpress-mu-541e47c09b503df8bd9b6d149c82cb8d98ac2710.tar.xz
wordpress-mu-541e47c09b503df8bd9b6d149c82cb8d98ac2710.zip
WP Merge to revision 8195
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@1342 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-admin/js')
-rw-r--r--wp-admin/js/media-upload.js23
-rw-r--r--wp-admin/js/theme-preview.js2
2 files changed, 17 insertions, 8 deletions
diff --git a/wp-admin/js/media-upload.js b/wp-admin/js/media-upload.js
index 8c88270..99acd26 100644
--- a/wp-admin/js/media-upload.js
+++ b/wp-admin/js/media-upload.js
@@ -1,13 +1,15 @@
// send html to the post editor
function send_to_editor(h) {
- var win = window.dialogArguments || opener || parent || top;
+ if ( typeof tinyMCE != 'undefined' && ( ed = tinyMCE.activeEditor ) && !ed.isHidden() ) {
+ ed.focus();
+ if (tinymce.isIE)
+ ed.selection.moveToBookmark(tinymce.EditorManager.activeEditor.windowManager.bookmark);
- tinyMCE = win.tinyMCE;
- if ( typeof tinyMCE != 'undefined' && ( ed = tinyMCE.getInstanceById('content') ) && !ed.isHidden() ) {
- tinyMCE.selectedInstance.getWin().focus();
- tinyMCE.execCommand('mceInsertContent', false, h);
+ ed.execCommand('mceInsertContent', false, h);
} else
- win.edInsertContent(win.edCanvas, h);
+ edInsertContent(edCanvas, h);
+
+ tb_remove();
}
// thickbox settings
@@ -22,7 +24,7 @@ jQuery(function($) {
tbWindow.width( W - 50 ).height( H - 45 );
$('#TB_iframeContent').width( W - 50 ).height( H - 75 );
tbWindow.css({'margin-left': '-' + parseInt((( W - 50 ) / 2),10) + 'px'});
- if ( ! ( $.browser.msie && $.browser.version.substr(0,1) < 7 ) )
+ if ( typeof document.body.style.maxWidth != 'undefined' )
tbWindow.css({'top':'20px','margin-top':'0'});
$('#TB_title').css({'background-color':'#222','color':'#cfcfcf'});
};
@@ -35,6 +37,13 @@ jQuery(function($) {
$(this).attr( 'href', href + '&width=' + ( W - 80 ) + '&height=' + ( H - 85 ) );
});
};
+
+ jQuery('a.thickbox').click(function(){
+ if ( typeof tinyMCE != 'undefined' && tinyMCE.activeEditor ) {
+ tinyMCE.get('content').focus();
+ tinyMCE.activeEditor.windowManager.bookmark = tinyMCE.activeEditor.selection.getBookmark('simple');
+ }
+ });
$(window).resize( function() { tb_position() } );
});
diff --git a/wp-admin/js/theme-preview.js b/wp-admin/js/theme-preview.js
index 43b01cd..f4f85e8 100644
--- a/wp-admin/js/theme-preview.js
+++ b/wp-admin/js/theme-preview.js
@@ -12,7 +12,7 @@ jQuery(function($) {
tbWindow.width( W - 90 ).height( H - 60 );
$('#TB_iframeContent').width( W - 90 ).height( H - 90 );
tbWindow.css({'margin-left': '-' + parseInt((( W - 90 ) / 2),10) + 'px'});
- if ( ! ( $.browser.msie && $.browser.version.substr(0,1) < 7 ) )
+ if ( typeof document.body.style.maxWidth != 'undefined' )
tbWindow.css({'top':'30px','margin-top':'0'});
};