summaryrefslogtreecommitdiffstats
path: root/wp-admin/js
diff options
context:
space:
mode:
authordonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2008-06-10 14:08:54 +0000
committerdonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2008-06-10 14:08:54 +0000
commit310940b824eff4a116dcd72ccd339bb602021981 (patch)
tree19f6efc7b30b9456eebc26d578c5dc7e125bb6e7 /wp-admin/js
parent616f7399dc4c4f7c56951c7b87a7aa91b3e690a3 (diff)
Merge with branches/2.5 in WordPress, revision 8066
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@1324 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-admin/js')
-rw-r--r--wp-admin/js/link.js3
-rw-r--r--wp-admin/js/media-upload.js35
-rw-r--r--wp-admin/js/widgets.js8
3 files changed, 38 insertions, 8 deletions
diff --git a/wp-admin/js/link.js b/wp-admin/js/link.js
index cfc0f94..2b3fa65 100644
--- a/wp-admin/js/link.js
+++ b/wp-admin/js/link.js
@@ -1,4 +1,7 @@
jQuery(document).ready( function() {
+ // close postboxes that should be closed
+ jQuery('.if-js-closed').removeClass('if-js-closed').addClass('closed');
+
jQuery('#link_name').focus();
// postboxes
add_postbox_toggles('link');
diff --git a/wp-admin/js/media-upload.js b/wp-admin/js/media-upload.js
index b8c615d..506faf8 100644
--- a/wp-admin/js/media-upload.js
+++ b/wp-admin/js/media-upload.js
@@ -1,12 +1,39 @@
// send html to the post editor
function send_to_editor(h) {
- var win = window.opener ? window.opener : window.dialogArguments;
- if ( !win )
- win = top;
+ var win = window.dialogArguments || opener || parent || top;
+
tinyMCE = win.tinyMCE;
if ( typeof tinyMCE != 'undefined' && ( ed = tinyMCE.getInstanceById('content') ) && !ed.isHidden() ) {
tinyMCE.selectedInstance.getWin().focus();
tinyMCE.execCommand('mceInsertContent', false, h);
} else
win.edInsertContent(win.edCanvas, h);
-} \ No newline at end of file
+}
+
+// thickbox settings
+jQuery(function($) {
+ tb_position = function() {
+ var tbWindow = $('#TB_window');
+ var width = $(window).width();
+ var H = $(window).height();
+ var W = ( 720 < width ) ? 720 : width;
+
+ if ( tbWindow.size() ) {
+ tbWindow.width( W - 50 ).height( H - 45 );
+ $('#TB_iframeContent').width( W - 50 ).height( H - 75 );
+ tbWindow.css({marginLeft: '-' + parseInt((( W - 50 ) / 2),10) + 'px'});
+ };
+
+ return $('a.thickbox').each( function() {
+ var href = $(this).attr('href');
+ if ( ! href ) return;
+ href = href.replace(/&width=[0-9]+/g, '');
+ href = href.replace(/&height=[0-9]+/g, '');
+ $(this).attr( 'href', href + '&width=' + ( W - 80 ) + '&height=' + ( H - 85 ) );
+ });
+ };
+
+ $(window).resize( function() { tb_position() } );
+ $(document).ready( function() { tb_position() } );
+});
+
diff --git a/wp-admin/js/widgets.js b/wp-admin/js/widgets.js
index 4eb37ee..b42812f 100644
--- a/wp-admin/js/widgets.js
+++ b/wp-admin/js/widgets.js
@@ -13,12 +13,12 @@ jQuery(function($) {
if ( t.is(':visible') ) {
if ( disableFields ) { t.find( ':input:enabled' ).not( '[name="widget-id[]"], [name*="[submit]"]' ).attr( 'disabled', 'disabled' ); }
li.css( 'marginLeft', 0 );
- t.siblings('h4').children('a').text( widgetsL10n.edit );
+ t.siblings('div').children('h4').children('a').text( widgetsL10n.edit );
} else {
t.find( ':disabled' ).attr( 'disabled', '' ); // always enable on open
if ( width > 250 )
li.css( 'marginLeft', ( width - 250 ) * -1 );
- t.siblings('h4').children('a').text( widgetsL10n.cancel );
+ t.siblings('div').children('h4').children('a').text( widgetsL10n.cancel );
}
t.toggle();
} : function() {
@@ -28,12 +28,12 @@ jQuery(function($) {
if ( disableFields ) { t.find( ':input:enabled' ).not( '[name="widget-id[]"], [name*="[submit]"]' ).attr( 'disabled', 'disabled' ); }
if ( width > 250 )
li.animate( { marginLeft: 0 } );
- t.siblings('h4').children('a').text( widgetsL10n.edit );
+ t.siblings('div').children('h4').children('a').text( widgetsL10n.edit );
} else {
t.find( ':disabled' ).attr( 'disabled', '' ); // always enable on open
if ( width > 250 )
li.animate( { marginLeft: ( width - 250 ) * -1 } );
- t.siblings('h4').children('a').text( widgetsL10n.cancel );
+ t.siblings('div').children('h4').children('a').text( widgetsL10n.cancel );
}
t.animate( { height: 'toggle' } );
};