diff --git a/wp-admin/includes/misc.php b/wp-admin/includes/misc.php index 59544d04e3..d020e74add 100644 --- a/wp-admin/includes/misc.php +++ b/wp-admin/includes/misc.php @@ -341,11 +341,35 @@ jQuery('#template').submit(function(){ if (jQuery('#newcontent_cp').length) jQuery('#newcontent_cp').val(newcontent.getCode()).removeAttr('disabled'); }); +jQuery('#codepress-on').hide(); +jQuery('#codepress-off').show(); /* ]]> */ ' . __('Enable syntax highlighting') . '' . __('Disable syntax highlighting') . "

\n"; + $show_screen = true; + break; case 'widgets': if ( !isset($_wp_contextual_help['widgets']) ) { $help = widgets_help(); $_wp_contextual_help['widgets'] = $help; } - $widgets_access = '

' . __('Enable accessibility mode') . '' . __('Disable accessibility mode') . "

\n"; + $settings = '

' . __('Enable accessibility mode') . '' . __('Disable accessibility mode') . "

\n"; $show_screen = true; break; } @@ -3500,7 +3505,7 @@ function screen_meta($screen) { - +
diff --git a/wp-admin/plugin-editor.php b/wp-admin/plugin-editor.php index 57ff60fccb..e297ef4ce6 100644 --- a/wp-admin/plugin-editor.php +++ b/wp-admin/plugin-editor.php @@ -83,8 +83,8 @@ default: exit; } - wp_enqueue_script( 'codepress' ); - add_action( 'admin_print_footer_scripts', 'codepress_footer_js' ); + if ( use_codepress() ) + wp_enqueue_script( 'codepress' ); // List of allowable extensions $editable_extensions = array('php', 'txt', 'text', 'js', 'css', 'html', 'htm', 'xml', 'inc', 'include'); diff --git a/wp-admin/theme-editor.php b/wp-admin/theme-editor.php index 7713fa5db7..db79d786ea 100644 --- a/wp-admin/theme-editor.php +++ b/wp-admin/theme-editor.php @@ -77,8 +77,9 @@ default: if ( !current_user_can('edit_themes') ) wp_die('

'.__('You do not have sufficient permissions to edit themes for this blog.').'

'); - wp_enqueue_script( 'codepress' ); - add_action( 'admin_print_footer_scripts', 'codepress_footer_js' ); + if ( use_codepress() ) + wp_enqueue_script( 'codepress' ); + require_once('admin-header.php'); update_recently_edited($file); diff --git a/wp-admin/wp-admin.css b/wp-admin/wp-admin.css index b7a693b263..508ad9b466 100644 --- a/wp-admin/wp-admin.css +++ b/wp-admin/wp-admin.css @@ -2116,7 +2116,8 @@ td.plugin-title { /* Global classes */ .wp-hidden-children .wp-hidden-child, -.ui-tabs-hide { +.ui-tabs-hide, +#codepress-off { display: none; } diff --git a/wp-includes/js/codepress/codepress.js b/wp-includes/js/codepress/codepress.js index 7698b60384..804f29a005 100644 --- a/wp-includes/js/codepress/codepress.js +++ b/wp-includes/js/codepress/codepress.js @@ -122,8 +122,8 @@ CodePress.run = function() { if (navigator.userAgent.toLowerCase().indexOf('webkit') != -1) return; CodePress.path = codepress_path; - t = document.getElementsByTagName('textarea'); - for(var i=0,n=t.length;i