Changeset 11530
- Timestamp:
- 06/07/2009 01:52:44 AM (15 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/misc.php
r11450 r11530 342 342 jQuery('#newcontent_cp').val(newcontent.getCode()).removeAttr('disabled'); 343 343 }); 344 jQuery('#codepress-on').hide(); 345 jQuery('#codepress-off').show(); 344 346 /* ]]> */ 345 347 </script> 346 348 <?php 349 } 350 351 /** 352 * Determine whether to use CodePress or not. 353 * 354 * @since 2.8 355 **/ 356 function use_codepress() { 357 358 if ( isset($_GET['codepress']) ) { 359 $on = 'on' == $_GET['codepress'] ? 'on' : 'off'; 360 set_user_setting( 'codepress', $on ); 361 } else { 362 $on = get_user_setting('codepress', 'on'); 363 } 364 365 if ( 'on' == $on ) { 366 add_action( 'admin_print_footer_scripts', 'codepress_footer_js' ); 367 return true; 368 } 369 370 return false; 347 371 } 348 372 -
trunk/wp-admin/includes/template.php
r11503 r11530 3432 3432 $_wp_contextual_help = array(); 3433 3433 3434 $ widgets_access = '';3434 $settings = ''; 3435 3435 3436 3436 switch ( $screen ) { … … 3472 3472 } 3473 3473 break; 3474 case 'theme-editor': 3475 case 'plugin-editor': 3476 $settings = '<p><a id="codepress-on" href="' . $screen . '.php?codepress=on">' . __('Enable syntax highlighting') . '</a><a id="codepress-off" href="' . $screen . '.php?codepress=off">' . __('Disable syntax highlighting') . "</a></p>\n"; 3477 $show_screen = true; 3478 break; 3474 3479 case 'widgets': 3475 3480 if ( !isset($_wp_contextual_help['widgets']) ) { … … 3477 3482 $_wp_contextual_help['widgets'] = $help; 3478 3483 } 3479 $ widgets_access = '<p><a id="access-on" href="widgets.php?widgets-access=on">' . __('Enable accessibility mode') . '</a><a id="access-off" href="widgets.php?widgets-access=off">' . __('Disable accessibility mode') . "</a></p>\n";3484 $settings = '<p><a id="access-on" href="widgets.php?widgets-access=on">' . __('Enable accessibility mode') . '</a><a id="access-off" href="widgets.php?widgets-access=off">' . __('Disable accessibility mode') . "</a></p>\n"; 3480 3485 $show_screen = true; 3481 3486 break; … … 3501 3506 <?php echo screen_layout($screen); ?> 3502 3507 <?php echo $screen_options; ?> 3503 <?php echo $ widgets_access; ?>3508 <?php echo $settings; ?> 3504 3509 <div><?php wp_nonce_field( 'screen-options-nonce', 'screenoptionnonce', false ); ?></div> 3505 3510 </form> -
trunk/wp-admin/plugin-editor.php
r11500 r11530 84 84 } 85 85 86 wp_enqueue_script( 'codepress' );87 add_action( 'admin_print_footer_scripts', 'codepress_footer_js' );86 if ( use_codepress() ) 87 wp_enqueue_script( 'codepress' ); 88 88 89 89 // List of allowable extensions -
trunk/wp-admin/theme-editor.php
r11380 r11530 78 78 wp_die('<p>'.__('You do not have sufficient permissions to edit themes for this blog.').'</p>'); 79 79 80 wp_enqueue_script( 'codepress' ); 81 add_action( 'admin_print_footer_scripts', 'codepress_footer_js' ); 80 if ( use_codepress() ) 81 wp_enqueue_script( 'codepress' ); 82 82 83 require_once('admin-header.php'); 83 84 -
trunk/wp-admin/wp-admin.css
r11526 r11530 2117 2117 2118 2118 .wp-hidden-children .wp-hidden-child, 2119 .ui-tabs-hide { 2119 .ui-tabs-hide, 2120 #codepress-off { 2120 2121 display: none; 2121 2122 } -
trunk/wp-includes/js/codepress/codepress.js
r10614 r11530 123 123 return; 124 124 CodePress.path = codepress_path; 125 t = document.getElementsByTagName('textarea');126 for( vari=0,n=t.length;i<n;i++) {125 var t = document.getElementsByTagName('textarea'), i, id; 126 for(i=0,n=t.length;i<n;i++) { 127 127 if(t[i].className.match('codepress')) { 128 128 id = t[i].id;
Note: See TracChangeset
for help on using the changeset viewer.