1 /* global plugininstallL10n, tb_click, confirm */
3 /* Plugin Browser Thickbox related JS*/
5 jQuery( document ).ready( function( $ ) {
6 tb_position = function() {
7 var tbWindow = $( '#TB_window' ),
8 width = $( window ).width(),
9 H = $( window ).height() - ( ( 850 < width ) ? 60 : 20 ),
10 W = ( 850 < width ) ? 830 : width - 20;
12 if ( tbWindow.size() ) {
13 tbWindow.width( W ).height( H );
14 $( '#TB_iframeContent' ).width( W ).height( H );
16 'margin-left': '-' + parseInt( ( W / 2 ), 10 ) + 'px'
18 if ( typeof document.body.style.maxWidth !== 'undefined' ) {
20 'top': ( ( 850 < width ) ? 30 : 10 ) + 'px',
26 return $( 'a.thickbox' ).each( function() {
27 var href = $( this ).attr( 'href' );
31 href = href.replace( /&width=[0-9]+/g, '' );
32 href = href.replace( /&height=[0-9]+/g, '' );
33 $(this).attr( 'href', href + '&width=' + W + '&height=' + ( H ) );
37 $( window ).resize( function() {
41 $('.plugins').on( 'click', 'a.thickbox', function() {
44 $('#TB_title').css({'background-color':'#222','color':'#cfcfcf'});
45 $('#TB_ajaxWindowTitle').html('<strong>' + plugininstallL10n.plugin_information + '</strong> ' + $(this).attr('title') );
49 /* Plugin install related JS*/
50 $( '#plugin-information-tabs a' ).click( function( event ) {
51 var tab = $( this ).attr( 'name' );
52 event.preventDefault();
54 $( '#plugin-information-tabs a.current' ).removeClass( 'current' );
55 $( this ).addClass( 'current' );
57 $( '#section-holder div.section' ).hide(); //Hide 'em all
58 $( '#section-' + tab ).show();
61 $( 'a.install-now' ).click( function() {
62 return confirm( plugininstallL10n.ays );