Changeset 14718
- Timestamp:
- 05/18/2010 03:48:22 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 2 deleted
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/css/wp-admin.dev.css
r14673 r14718 2156 2156 2157 2157 .wp-hidden-children .wp-hidden-child, 2158 .ui-tabs-hide, 2159 #codepress-off { 2158 .ui-tabs-hide { 2160 2159 display: none; 2161 2160 } -
trunk/wp-admin/includes/deprecated.php
r13805 r14718 163 163 } 164 164 165 /** 166 * Determines the language to use for CodePress syntax highlighting. 167 * 168 * @since 2.8.0 169 * @deprecated 3.0.0 170 * 171 * @param string $filename 172 **/ 173 function codepress_get_lang( $filename ) { 174 _deprecated_function( __FUNCTION__, '3.0' ); 175 return; 176 } 177 178 /** 179 * Adds Javascript required to make CodePress work on the theme/plugin editors. 180 * 181 * @since 2.8.0 182 * @deprecated 3.0.0 183 **/ 184 function codepress_footer_js() { 185 _deprecated_function( __FUNCTION__, '3.0' ); 186 return; 187 } 188 189 /** 190 * Determine whether to use CodePress. 191 * 192 * @since 2.8 193 * @deprecated 3.0.0 194 **/ 195 function use_codepress() { 196 _deprecated_function( __FUNCTION__, '3.0' ); 197 return; 198 } 199 165 200 ?> -
trunk/wp-admin/includes/misc.php
r14312 r14718 314 314 315 315 /** 316 * Determines the language to use for CodePress syntax highlighting,317 * based only on a filename.318 *319 * @since 2.8320 *321 * @param string $filename The name of the file to be highlighting322 **/323 function codepress_get_lang( $filename ) {324 $codepress_supported_langs = apply_filters( 'codepress_supported_langs',325 array( '.css' => 'css',326 '.js' => 'javascript',327 '.php' => 'php',328 '.html' => 'html',329 '.htm' => 'html',330 '.txt' => 'text'331 ) );332 $extension = substr( $filename, strrpos( $filename, '.' ) );333 if ( $extension && array_key_exists( $extension, $codepress_supported_langs ) )334 return $codepress_supported_langs[$extension];335 336 return 'generic';337 }338 339 /**340 * Adds Javascript required to make CodePress work on the theme/plugin editors.341 *342 * This code is attached to the action admin_print_footer_scripts.343 *344 * @since 2.8345 **/346 function codepress_footer_js() {347 // Script-loader breaks CP's automatic path-detection, thus CodePress.path348 // CP edits in an iframe, so we need to grab content back into normal form349 ?><script type="text/javascript">350 /* <![CDATA[ */351 var codepress_path = '<?php echo includes_url('js/codepress/'); ?>';352 jQuery('#template').submit(function(){353 if (jQuery('#newcontent_cp').length)354 jQuery('#newcontent_cp').val(newcontent.getCode()).removeAttr('disabled');355 });356 jQuery('#codepress-on').hide();357 jQuery('#codepress-off').show();358 /* ]]> */359 </script>360 <?php361 }362 363 /**364 * Determine whether to use CodePress.365 *366 * @since 2.8367 **/368 function use_codepress() {369 370 if ( isset($_GET['codepress']) ) {371 $on = 'on' == $_GET['codepress'] ? 'on' : 'off';372 set_user_setting( 'codepress', $on );373 } else {374 $on = get_user_setting('codepress', 'on');375 }376 377 if ( 'on' == $on ) {378 add_action( 'admin_print_footer_scripts', 'codepress_footer_js' );379 return true;380 }381 382 return false;383 }384 385 /**386 316 * Saves option for number of rows when listing posts, pages, comments, etc. 387 317 * -
trunk/wp-admin/plugin-editor.php
r14348 r14718 128 128 129 129 $content = htmlspecialchars( $content ); 130 $codepress_lang = codepress_get_lang($real_file);131 132 130 ?> 133 131 <?php if (isset($_GET['a'])) : ?> … … 207 205 <form name="template" id="template" action="plugin-editor.php" method="post"> 208 206 <?php wp_nonce_field('edit-plugin_' . $file) ?> 209 <div><textarea cols="70" rows="25" name="newcontent" id="newcontent" tabindex="1" class="codepress <?php echo $codepress_lang ?>"><?php echo $content ?></textarea>207 <div><textarea cols="70" rows="25" name="newcontent" id="newcontent" tabindex="1"><?php echo $content ?></textarea> 210 208 <input type="hidden" name="action" value="update" /> 211 209 <input type="hidden" name="file" value="<?php echo esc_attr($file) ?>" /> -
trunk/wp-admin/theme-editor.php
r14647 r14718 103 103 104 104 $content = htmlspecialchars( $content ); 105 $codepress_lang = codepress_get_lang($file);106 105 } 107 106 … … 196 195 <form name="template" id="template" action="theme-editor.php" method="post"> 197 196 <?php wp_nonce_field('edit-theme_' . $file . $theme) ?> 198 <div><textarea cols="70" rows="25" name="newcontent" id="newcontent" tabindex="1" class="codepress <?php echo $codepress_lang ?>"><?php echo $content ?></textarea>197 <div><textarea cols="70" rows="25" name="newcontent" id="newcontent" tabindex="1"><?php echo $content ?></textarea> 199 198 <input type="hidden" name="action" value="update" /> 200 199 <input type="hidden" name="file" value="<?php echo esc_attr($file) ?>" /> -
trunk/wp-includes/script-loader.php
r14715 r14718 164 164 $scripts->add( 'jquery-table-hotkeys', "/wp-includes/js/jquery/jquery.table-hotkeys$suffix.js", array('jquery', 'jquery-hotkeys'), '20090102' ); 165 165 $scripts->add_data( 'jquery-table-hotkeys', 'group', 1 ); 166 167 $scripts->add( 'jquery-autocomplete', "/wp-includes/js/jquery/autocomplete$suffix.js", array('jquery'), '1.1' );168 $scripts->add_data( 'jquery-autocomplete', 'group', 1 );169 166 170 167 $scripts->add( 'thickbox', "/wp-includes/js/thickbox/thickbox.js", array('jquery'), '3.1-20100407'); … … 378 375 $scripts->add_data( 'media', 'group', 1 ); 379 376 380 $scripts->add( 'codepress', '/wp-includes/js/codepress/codepress.js', false, '0.9.6' );381 $scripts->add_data( 'codepress', 'group', 1 );382 383 377 $scripts->add( 'image-edit', "/wp-admin/js/image-edit$suffix.js", array('jquery', 'json2', 'imgareaselect'), '20091111' ); 384 378 $scripts->add_data( 'image-edit', 'group', 1 );
Note: See TracChangeset
for help on using the changeset viewer.