From e7486800d9f72650ce41fef163d9fecbfc4c1c8e Mon Sep 17 00:00:00 2001 From: nacin Date: Fri, 2 Apr 2010 23:27:23 +0000 Subject: [PATCH] Add AYS to "Install Now" link in plugin installer. fixes #11050 git-svn-id: http://svn.automattic.com/wordpress/trunk@13951 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/plugin-install.php | 2 +- wp-admin/js/plugin-install.dev.js | 4 ++++ wp-admin/js/plugin-install.js | 2 +- wp-includes/script-loader.php | 3 ++- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/wp-admin/includes/plugin-install.php b/wp-admin/includes/plugin-install.php index 388fa2b413..f06286d5dc 100644 --- a/wp-admin/includes/plugin-install.php +++ b/wp-admin/includes/plugin-install.php @@ -363,7 +363,7 @@ function display_plugins_table($plugins, $page = 1, $totalpages = 1){ switch ( $status['status'] ) { case 'install': if ( $status['url'] ) - $action_links[] = '' . __('Install Now') . ''; + $action_links[] = '' . __('Install Now') . ''; break; case 'update_available': if ( $status['url'] ) diff --git a/wp-admin/js/plugin-install.dev.js b/wp-admin/js/plugin-install.dev.js index fabb1aa6b1..1bd26870a7 100644 --- a/wp-admin/js/plugin-install.dev.js +++ b/wp-admin/js/plugin-install.dev.js @@ -38,4 +38,8 @@ jQuery(document).ready(function($) { $('#section-' + tab).show(); return false; }); + + $('#install-plugins .action-links .install-now').click( function() { + return confirm( plugininstallL10n.ays ); + }); }); diff --git a/wp-admin/js/plugin-install.js b/wp-admin/js/plugin-install.js index cbe0c5e26b..10f75eb4d7 100644 --- a/wp-admin/js/plugin-install.js +++ b/wp-admin/js/plugin-install.js @@ -1 +1 @@ -jQuery(document).ready(function(b){var a=function(){var f=b("#TB_window"),e=b(window).width(),d=b(window).height(),c=(720"+plugininstallL10n.plugin_information+" "+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})}); \ No newline at end of file +jQuery(document).ready(function(b){var a=function(){var f=b("#TB_window"),e=b(window).width(),d=b(window).height(),c=(720"+plugininstallL10n.plugin_information+" "+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);});}); \ No newline at end of file diff --git a/wp-includes/script-loader.php b/wp-includes/script-loader.php index 3bb8110676..830b9146e6 100644 --- a/wp-includes/script-loader.php +++ b/wp-includes/script-loader.php @@ -362,10 +362,11 @@ function wp_default_scripts( &$scripts ) { 'l10n_print_after' => 'try{convertEntities(inlineEditL10n);}catch(e){};' ) ); - $scripts->add( 'plugin-install', "/wp-admin/js/plugin-install$suffix.js", array( 'jquery' ), '20090520' ); + $scripts->add( 'plugin-install', "/wp-admin/js/plugin-install$suffix.js", array( 'jquery' ), '20100402' ); $scripts->add_data( 'plugin-install', 'group', 1 ); $scripts->localize( 'plugin-install', 'plugininstallL10n', array( 'plugin_information' => __('Plugin Information:'), + 'ays' => __('Are you sure you want to install this plugin?'), 'l10n_print_after' => 'try{convertEntities(plugininstallL10n);}catch(e){};' ) );