1 | /* Plugin Browser Thickbox related JS*/
|
---|
2 | jQuery(document).ready(function($) {
|
---|
3 | var thickDims = function() {
|
---|
4 | var tbWindow = $('#TB_window'), width = $(window).width(), H = $(window).height(), W = ( 720 < width ) ? 720 : width;
|
---|
5 |
|
---|
6 | if ( tbWindow.size() ) {
|
---|
7 | tbWindow.width( W - 50 ).height( H - 45 );
|
---|
8 | $('#TB_iframeContent').width( W - 50 ).height( H - 75 );
|
---|
9 | tbWindow.css({'margin-left': '-' + parseInt((( W - 50 ) / 2),10) + 'px'});
|
---|
10 | if ( ! ( $.browser.msie && $.browser.version.substr(0,1) < 7 ) )
|
---|
11 | tbWindow.css({'top':'20px','margin-top':'0'});
|
---|
12 | };
|
---|
13 |
|
---|
14 | return $('#dashboard_plugins a.thickbox, .plugins a.thickbox').each( function() {
|
---|
15 | var href = $(this).attr('href');
|
---|
16 | if ( ! href )
|
---|
17 | return;
|
---|
18 | href = href.replace(/&width=[0-9]+/g, '');
|
---|
19 | href = href.replace(/&height=[0-9]+/g, '');
|
---|
20 | $(this).attr( 'href', href + '&width=' + ( W - 80 ) + '&height=' + ( H - 85 ) );
|
---|
21 | });
|
---|
22 | };
|
---|
23 |
|
---|
24 | thickDims().click( function() {
|
---|
25 | $('#TB_title').css({'background-color':'#222','color':'#cfcfcf'});
|
---|
26 | $('#TB_ajaxWindowTitle').html('<strong>' + plugininstallL10n.plugin_information + '</strong> ' + $(this).attr('title') );
|
---|
27 | return false;
|
---|
28 | });
|
---|
29 |
|
---|
30 | /* Plugin install related JS*/
|
---|
31 | $('#plugin-information #sidemenu a').click( function() {
|
---|
32 | var tab = $(this).attr('name');
|
---|
33 | //Flip the tab
|
---|
34 | $('#plugin-information-header a.current').removeClass('current');
|
---|
35 | $(this).addClass('current');
|
---|
36 | //Flip the content.
|
---|
37 | $('#section-holder div.section').hide(); //Hide 'em all
|
---|
38 | $('#section-' + tab).show();
|
---|
39 | return false;
|
---|
40 | });
|
---|
41 | });
|
---|