diff --git a/wp-admin/js/plugin-install.js b/wp-admin/js/plugin-install.js index 4cd1bb8eb4..8954766838 100644 --- a/wp-admin/js/plugin-install.js +++ b/wp-admin/js/plugin-install.js @@ -11,7 +11,9 @@ jQuery( document ).ready( function( $ ) { $iframeBody, $tabbables, $firstTabbable, - $lastTabbable; + $lastTabbable, + uploadViewToggle = $( '.upload-view-toggle' ), + $body = $( document.body ); tb_position = function() { var width = $( window ).width(), @@ -53,7 +55,7 @@ jQuery( document ).ready( function( $ ) { * Custom events: when a Thickbox iframe has loaded and when the Thickbox * modal gets removed from the DOM. */ - $( 'body' ) + $body .on( 'thickbox:iframe:loaded', tbWindow, function() { iframeLoaded(); }) @@ -180,19 +182,21 @@ jQuery( document ).ready( function( $ ) { /* * When a user presses the "Upload Plugin" button, show the upload form in place * rather than sending them to the devoted upload plugin page. - * @todo consider to abstract this in a generic, reusable, utility, see theme.js + * The `?tab=upload` page still exists for no-js support and for plugins that + * might access it directly (?). When we're in this page, let the link behave + * like a link. Otherwise we're in the normal plugin installer pages and the + * link should behave like a toggle button. */ - var uploadViewToggle = $( '.upload-view-toggle' ), - $body = $( document.body ); - - uploadViewToggle - .attr({ - role: 'button', - 'aria-expanded': 'false' - }) - .on( 'click', function( event ) { - event.preventDefault(); - $body.toggleClass( 'show-upload-view' ); - uploadViewToggle.attr( 'aria-expanded', $body.hasClass( 'show-upload-view' ) ); - }); + if ( ! uploadViewToggle.hasClass( 'upload-tab' ) ) { + uploadViewToggle + .attr({ + role: 'button', + 'aria-expanded': 'false' + }) + .on( 'click', function( event ) { + event.preventDefault(); + $body.toggleClass( 'show-upload-view' ); + uploadViewToggle.attr( 'aria-expanded', $body.hasClass( 'show-upload-view' ) ); + }); + } }); diff --git a/wp-admin/js/plugin-install.min.js b/wp-admin/js/plugin-install.min.js index 2cca19cc82..628cb6ad97 100644 --- a/wp-admin/js/plugin-install.min.js +++ b/wp-admin/js/plugin-install.min.js @@ -1 +1 @@ -var tb_position;jQuery(document).ready(function(a){function b(){var b=e.find("#TB_iframeContent");g=b.contents().find("body"),c(),i.focus(),a("#plugin-information-tabs a",g).on("click",function(){c()}),g.on("keydown",function(a){27===a.which&&tb_remove()})}function c(){var b;h=a(":tabbable",g),i=e.find("#TB_closeWindowButton"),j=h.last(),b=i.add(j),b.off("keydown.wp-plugin-details"),b.on("keydown.wp-plugin-details",function(a){d(a)})}function d(a){9===a.which&&(j[0]!==a.target||a.shiftKey?i[0]===a.target&&a.shiftKey&&(a.preventDefault(),j.focus()):(a.preventDefault(),i.focus()))}var e,f,g,h,i,j;tb_position=function(){var b=a(window).width(),c=a(window).height()-(b>792?60:20),d=b>792?772:b-20;return e=a("#TB_window"),e.length&&(e.width(d).height(c),a("#TB_iframeContent").width(d).height(c),e.css({"margin-left":"-"+parseInt(d/2,10)+"px"}),"undefined"!=typeof document.body.style.maxWidth&&e.css({top:"30px","margin-top":"0"})),a("a.thickbox").each(function(){var b=a(this).attr("href");b&&(b=b.replace(/&width=[0-9]+/g,""),b=b.replace(/&height=[0-9]+/g,""),a(this).attr("href",b+"&width="+d+"&height="+c))})},a(window).resize(function(){tb_position()}),a("body").on("thickbox:iframe:loaded",e,function(){b()}).on("thickbox:removed",function(){f.focus()}),a(".thickbox.open-plugin-details-modal").on("click",function(b){var c=a(this).data("title")?plugininstallL10n.plugin_information+" "+a(this).data("title"):plugininstallL10n.plugin_modal_label;b.preventDefault(),b.stopPropagation(),f=a(this),tb_click.call(this),e.attr({role:"dialog","aria-label":plugininstallL10n.plugin_modal_label}),e.find("#TB_iframeContent").attr("title",c)}),a("#plugin-information-tabs a").click(function(b){var c=a(this).attr("name");b.preventDefault(),a("#plugin-information-tabs a.current").removeClass("current"),a(this).addClass("current"),"description"!==c&&a(window).width()<772?a("#plugin-information-content").find(".fyi").hide():a("#plugin-information-content").find(".fyi").show(),a("#section-holder div.section").hide(),a("#section-"+c).show()});var k=a(".upload-view-toggle"),l=a(document.body);k.attr({role:"button","aria-expanded":"false"}).on("click",function(a){a.preventDefault(),l.toggleClass("show-upload-view"),k.attr("aria-expanded",l.hasClass("show-upload-view"))})}); \ No newline at end of file +var tb_position;jQuery(document).ready(function(a){function b(){var b=e.find("#TB_iframeContent");g=b.contents().find("body"),c(),i.focus(),a("#plugin-information-tabs a",g).on("click",function(){c()}),g.on("keydown",function(a){27===a.which&&tb_remove()})}function c(){var b;h=a(":tabbable",g),i=e.find("#TB_closeWindowButton"),j=h.last(),b=i.add(j),b.off("keydown.wp-plugin-details"),b.on("keydown.wp-plugin-details",function(a){d(a)})}function d(a){9===a.which&&(j[0]!==a.target||a.shiftKey?i[0]===a.target&&a.shiftKey&&(a.preventDefault(),j.focus()):(a.preventDefault(),i.focus()))}var e,f,g,h,i,j,k=a(".upload-view-toggle"),l=a(document.body);tb_position=function(){var b=a(window).width(),c=a(window).height()-(b>792?60:20),d=b>792?772:b-20;return e=a("#TB_window"),e.length&&(e.width(d).height(c),a("#TB_iframeContent").width(d).height(c),e.css({"margin-left":"-"+parseInt(d/2,10)+"px"}),"undefined"!=typeof document.body.style.maxWidth&&e.css({top:"30px","margin-top":"0"})),a("a.thickbox").each(function(){var b=a(this).attr("href");b&&(b=b.replace(/&width=[0-9]+/g,""),b=b.replace(/&height=[0-9]+/g,""),a(this).attr("href",b+"&width="+d+"&height="+c))})},a(window).resize(function(){tb_position()}),l.on("thickbox:iframe:loaded",e,function(){b()}).on("thickbox:removed",function(){f.focus()}),a(".thickbox.open-plugin-details-modal").on("click",function(b){var c=a(this).data("title")?plugininstallL10n.plugin_information+" "+a(this).data("title"):plugininstallL10n.plugin_modal_label;b.preventDefault(),b.stopPropagation(),f=a(this),tb_click.call(this),e.attr({role:"dialog","aria-label":plugininstallL10n.plugin_modal_label}),e.find("#TB_iframeContent").attr("title",c)}),a("#plugin-information-tabs a").click(function(b){var c=a(this).attr("name");b.preventDefault(),a("#plugin-information-tabs a.current").removeClass("current"),a(this).addClass("current"),"description"!==c&&a(window).width()<772?a("#plugin-information-content").find(".fyi").hide():a("#plugin-information-content").find(".fyi").show(),a("#section-holder div.section").hide(),a("#section-"+c).show()}),k.hasClass("upload-tab")||k.attr({role:"button","aria-expanded":"false"}).on("click",function(a){a.preventDefault(),l.toggleClass("show-upload-view"),k.attr("aria-expanded",l.hasClass("show-upload-view"))})}); \ No newline at end of file diff --git a/wp-includes/version.php b/wp-includes/version.php index 0335500840..9c4fb7f26b 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.6-alpha-37680'; +$wp_version = '4.6-alpha-37681'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.