WordPress.org

Make WordPress Core

Changeset 16963


Ignore:
Timestamp:
12/15/2010 06:48:40 PM (9 years ago)
Author:
nacin
Message:

Plugin install and thickbox for the network admin. props ocean90, fixes #15510, fixes #15750.

Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/ms.php

    r16938 r16963  
    720720    return false;
    721721}
     722
    722723/**
    723724 * Whether or not we can edit this network from this page
     
    738739    return apply_filters( 'can_edit_network', $result, $site_id );
    739740}
     741
     742/**
     743 * Thickbox image paths for Network Admin.
     744 *
     745 * @since 3.1.0
     746 * @access private
     747 */
     748function _thickbox_path_admin_subfolder() {
    740749?>
     750<script type="text/javascript">
     751//<![CDATA[
     752var tb_pathToImage = "../../wp-includes/js/thickbox/loadingAnimation.gif";
     753var tb_closeImage = "../../wp-includes/js/thickbox/tb-close.png";
     754//]]>
     755</script>
     756<?
     757}
     758
     759?>
  • trunk/wp-admin/js/plugin-install.dev.js

    r14030 r16963  
    11/* Plugin Browser Thickbox related JS*/
     2var tb_position;
    23jQuery(document).ready(function($) {
    3     var thickDims = function() {
    4         var tbWindow = $('#TB_window'), width = $(window).width(), H = $(window).height(), W = ( 720 < width ) ? 720 : width;
     4    tb_position = function() {
     5        var tbWindow = $('#TB_window'), width = $(window).width(), H = $(window).height(), W = ( 720 < width ) ? 720 : width, adminbar_height = 0;
     6
     7        if ( $('body.admin-bar').length )
     8            adminbar_height = 28;
    59
    610        if ( tbWindow.size() ) {
    7             tbWindow.width( W - 50 ).height( H - 45 );
    8             $('#TB_iframeContent').width( W - 50 ).height( H - 75 );
     11            tbWindow.width( W - 50 ).height( H - 45 - adminbar_height );
     12            $('#TB_iframeContent').width( W - 50 ).height( H - 75 - adminbar_height );
    913            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'});
     14            if ( typeof document.body.style.maxWidth != 'undefined' )
     15                tbWindow.css({'top': 20 + adminbar_height + 'px','margin-top':'0'});
    1216        };
    1317
     
    1822            href = href.replace(/&width=[0-9]+/g, '');
    1923            href = href.replace(/&height=[0-9]+/g, '');
    20             $(this).attr( 'href', href + '&width=' + ( W - 80 ) + '&height=' + ( H - 85 ) );
     24            $(this).attr( 'href', href + '&width=' + ( W - 80 ) + '&height=' + ( H - 85 - adminbar_height ) );
    2125        });
    2226    };
    2327
    24     thickDims().click( function() {
     28    $(window).resize(function(){ tb_position(); });
     29
     30     $('#dashboard_plugins a.thickbox, .plugins a.thickbox').click( function() {
    2531        tb_click.call(this);
    2632
  • trunk/wp-admin/js/plugin-install.js

    r14992 r16963  
    1 jQuery(document).ready(function(b){var a=function(){var f=b("#TB_window"),e=b(window).width(),d=b(window).height(),c=(720<e)?720:e;if(f.size()){f.width(c-50).height(d-45);b("#TB_iframeContent").width(c-50).height(d-75);f.css({"margin-left":"-"+parseInt(((c-50)/2),10)+"px"});if(!(b.browser.msie&&b.browser.version.substr(0,1)<7)){f.css({top:"20px","margin-top":"0"})}}return b("#dashboard_plugins a.thickbox, .plugins a.thickbox").each(function(){var g=b(this).attr("href");if(!g){return}g=g.replace(/&width=[0-9]+/g,"");g=g.replace(/&height=[0-9]+/g,"");b(this).attr("href",g+"&width="+(c-80)+"&height="+(d-85))})};a().click(function(){tb_click.call(this);b("#TB_title").css({"background-color":"#222",color:"#cfcfcf"});b("#TB_ajaxWindowTitle").html("<strong>"+plugininstallL10n.plugin_information+"</strong>&nbsp;"+b(this).attr("title"));return false});b("#plugin-information #sidemenu a").click(function(){var c=b(this).attr("name");b("#plugin-information-header a.current").removeClass("current");b(this).addClass("current");b("#section-holder div.section").hide();b("#section-"+c).show();return false});b("#install-plugins .action-links .install-now").click(function(){return confirm(plugininstallL10n.ays)})});
     1var tb_position;jQuery(document).ready(function(a){tb_position=function(){var f=a("#TB_window"),e=a(window).width(),d=a(window).height(),c=(720<e)?720:e,b=0;if(a("body.admin-bar").length){b=28}if(f.size()){f.width(c-50).height(d-45-b);a("#TB_iframeContent").width(c-50).height(d-75-b);f.css({"margin-left":"-"+parseInt(((c-50)/2),10)+"px"});if(typeof document.body.style.maxWidth!="undefined"){f.css({top:20+b+"px","margin-top":"0"})}}return a("#dashboard_plugins a.thickbox, .plugins a.thickbox").each(function(){var g=a(this).attr("href");if(!g){return}g=g.replace(/&width=[0-9]+/g,"");g=g.replace(/&height=[0-9]+/g,"");a(this).attr("href",g+"&width="+(c-80)+"&height="+(d-85-b))})};a(window).resize(function(){tb_position()});a("#dashboard_plugins a.thickbox, .plugins a.thickbox").click(function(){tb_click.call(this);a("#TB_title").css({"background-color":"#222",color:"#cfcfcf"});a("#TB_ajaxWindowTitle").html("<strong>"+plugininstallL10n.plugin_information+"</strong>&nbsp;"+a(this).attr("title"));return false});a("#plugin-information #sidemenu a").click(function(){var b=a(this).attr("name");a("#plugin-information-header a.current").removeClass("current");a(this).addClass("current");a("#section-holder div.section").hide();a("#section-"+b).show();return false});a("#install-plugins .action-links .install-now").click(function(){return confirm(plugininstallL10n.ays)})});
  • trunk/wp-admin/network/index.php

    r16474 r16963  
    3636
    3737wp_enqueue_script( 'dashboard' );
     38wp_enqueue_script( 'plugin-install' );
    3839wp_admin_css( 'dashboard' );
     40wp_admin_css( 'plugin-install' );
    3941add_thickbox();
    4042
  • trunk/wp-includes/general-template.php

    r16792 r16963  
    21552155    wp_enqueue_script( 'thickbox' );
    21562156    wp_enqueue_style( 'thickbox' );
     2157
     2158    if ( is_network_admin() )
     2159        add_action( 'admin_head', '_thickbox_path_admin_subfolder' );
    21572160}
    21582161
  • trunk/wp-includes/script-loader.php

    r16961 r16963  
    405405        ) );
    406406
    407         $scripts->add( 'plugin-install', "/wp-admin/js/plugin-install$suffix.js", array( 'jquery', 'thickbox' ), '20100407' );
     407        $scripts->add( 'plugin-install', "/wp-admin/js/plugin-install$suffix.js", array( 'jquery', 'thickbox' ), '20101215' );
    408408        $scripts->add_data( 'plugin-install', 'group', 1 );
    409409        $scripts->localize( 'plugin-install', 'plugininstallL10n', array(
Note: See TracChangeset for help on using the changeset viewer.