Changeset 8143
- Timestamp:
- 06/20/2008 05:57:14 PM (18 years ago)
- Location:
- branches/crazyhorse/wp-admin
- Files:
-
- 6 edited
-
admin-header.php (modified) (1 diff)
-
css/dashboard.css (modified) (1 diff)
-
includes/dashboard.php (modified) (4 diffs)
-
includes/post.php (modified) (1 diff)
-
post.php (modified) (1 diff)
-
press-this.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/crazyhorse/wp-admin/admin-header.php
r8115 r8143 2 2 @header('Content-Type: ' . get_option('html_type') . '; charset=' . get_option('blog_charset')); 3 3 if (!isset($_GET["page"])) require_once('admin.php'); 4 if ( $editing ) {5 if ( user_can_richedit() )6 wp_enqueue_script( 'wp_tiny_mce' );7 }8 4 wp_enqueue_script( 'wp-gears' ); 9 5 -
branches/crazyhorse/wp-admin/css/dashboard.css
r7453 r8143 55 55 font-weight: bold; 56 56 } 57 58 form .input-text-wrap { 59 border-style: solid; 60 border-width: 1px; 61 padding: 2px 3px; 62 border-color: #CCCCCC; 63 } 64 65 form .input-text-wrap input { 66 border: 0pt none; 67 outline-color: -moz-use-text-color; 68 outline-style: none; 69 outline-width: medium; 70 padding: 0pt; 71 width: 100%; 72 border-style: solid; 73 color: #333333; 74 } 75 76 form .textarea-wrap { 77 border-style: solid; 78 border-width: 1px; 79 padding: 0; 80 border-color: #CCCCCC; 81 } 82 83 form .textarea-wrap textarea { 84 border: 0pt none; 85 } 86 87 88 57 89 58 90 /* Widgets */ -
branches/crazyhorse/wp-admin/includes/dashboard.php
r8103 r8143 34 34 wp_register_sidebar_widget( 'dashboard_recent_comments', __( 'Recent Comments' ), 'wp_dashboard_recent_comments', 35 35 array( 'all_link' => 'edit-comments.php', 'notice' => $notice, 'width' => 'half' ) 36 ); 37 38 39 // QuickPress Widget 40 wp_register_sidebar_widget( 'dashboard_quick_press', __( 'QuickPress' ), 'wp_dashboard_quick_press', 41 array( 'width' => 'half', 'height' => 'double' ) 36 42 ); 37 43 … … 132 138 // Hard code the sidebar's widgets and order 133 139 $dashboard_widgets = array(); 140 $dashboard_widgets[] = 'dashboard_quick_press'; 134 141 $dashboard_widgets[] = 'dashboard_recent_comments'; 135 142 $dashboard_widgets[] = 'dashboard_incoming_links'; … … 141 148 // Filter widget order 142 149 $dashboard_widgets = apply_filters( 'wp_dashboard_widgets', $dashboard_widgets ); 150 if ( in_array( 'dashboard_quick_press', $dashboard_widgets ) ) { 151 add_action( 'admin_head', 'wp_teeny_mce' ); 152 add_action( 'admin_head', 'wp_dashboard_quick_press_js' ); 153 } 143 154 144 155 $wp_dashboard_sidebars = array( 'wp_dashboard' => $dashboard_widgets, 'array_version' => 3.5 ); … … 258 269 /* Dashboard Widgets */ 259 270 271 function wp_dashboard_quick_press( $sidebar_args ) { 272 extract( $sidebar_args, EXTR_SKIP ); 273 274 echo $before_widget; 275 276 echo $before_title; 277 echo $widget_name; 278 echo $after_title; 279 280 ?> 281 282 <form name="post" action="<?php echo clean_url( admin_url( 'post.php' ) ); ?>" method="post" id="quick-press"> 283 <h3><label for="title"><?php _e('Title') ?></label></h3> 284 <div class="input-text-wrap"> 285 <input type="text" name="post_title" id="title" autocomplete="off" /> 286 </div> 287 288 <h3><label for="content"><?php _e('Post') ?></label></h3> 289 <div class="textarea-wrap"> 290 <textarea name="content" id="quickpress-content" class="mceEditor" rows="3" cols="15"></textarea> 291 </div> 292 293 <h3><label for="tags-input"><?php _e('Tags') ?></label></h3> 294 <div class="input-text-wrap"> 295 <input type="text" name="tags_input" id="tags-input" /> 296 </div> 297 <p><?php _e('Separate tags with commas'); ?></p> 298 299 <p class="submit"> 300 <input type="hidden" name="action" value="post-quickpress" /> 301 <?php wp_nonce_field('add-post'); ?> 302 <input type="submit" name="save" id="save-post" class="button" value="<?php _e('Save'); ?>" /> 303 <input type="submit" name="publish" id="publish" accesskey="p" class="button button-highlighted" value="<?php _e('Publish'); ?>" /> 304 </p> 305 306 <?php 307 $drafts_query = new WP_Query( array( 308 'post_type' => 'post', 309 'what_to_show' => 'posts', 310 'post_status' => 'draft', 311 'author' => $GLOBALS['current_user']->ID, 312 'posts_per_page' => 5, 313 'orderby' => 'modified', 314 'order' => 'DESC' 315 ) ); 316 317 if ( $drafts_query->posts ) : 318 $list = array(); 319 foreach ( $drafts_query->posts as $draft ) { 320 $url = get_edit_post_link( $draft->ID ); 321 $title = get_the_title( $draft->ID ); 322 $list[] = "<a href='$url' title='" . sprintf( __( 'Edit "%s"' ), attribute_escape( $title ) ) . "'>$title</a>"; 323 } 324 ?> 325 326 <h3><?php _e('Recent Drafts'); ?></h3> 327 <p id='recent-drafts'> 328 <?php echo join( ', ', $list ); ?> 329 </p> 330 331 <?php 332 333 endif; // drafts 334 335 ?> 336 337 </form> 338 339 <?php 340 341 echo $after_widget; 342 } 343 344 function wp_dashboard_quick_press_js() { 345 ?> 346 <script type="text/javascript"> 347 /* <![CDATA[ */ 348 var quickPressLoad = function($) { 349 var t = $('#quick-press').submit( function() { 350 t.load( t.attr( 'action' ) + ' #quick-press', t.serializeArray(), function() { 351 quickPressLoad($); 352 if ( 'undefined' != typeof wpTeenyMCEInit && $.isFunction( wpTeenyMCEInit ) ) { wpTeenyMCEInit(); } 353 } ); 354 return false; 355 } ); 356 $('#publish').click( function() { t.append( "<input type='hidden' name='publish' value='publish' />" ); } ); 357 }; 358 jQuery( quickPressLoad ); 359 /* ]]> */ 360 </script> 361 <?php 362 } 363 364 260 365 function wp_dashboard_recent_comments( $sidebar_args ) { 261 366 global $comment; -
branches/crazyhorse/wp-admin/includes/post.php
r8034 r8143 682 682 return _wp_put_post_revision( $_POST, true ); 683 683 } 684 685 /** 686 * wp_teeny_mce() - adds a trimmed down version of the tinyMCE editor used on the Write -> Post screen. 687 * 688 * @package WordPress 689 * @since 2.6 690 */ 691 function wp_teeny_mce( $args = null ) { 692 if ( !user_can_richedit() ) 693 return; 694 695 $defaults = array( 696 'buttons1' => 'bold,italic,underline,blockquote,separator,strikethrough,bullist,numlist,undo,redo,link,unlink' 697 ); 698 $args = wp_parse_args( $args, $defaults ); 699 if ( is_array( $args['buttons1'] ) ) 700 $args['buttons1'] = join( ',', $args['buttons1'] ); 701 702 $language = ( '' == get_locale() ) ? 'en' : strtolower( substr(get_locale(), 0, 2) ); 703 704 ?> 705 706 <script type="text/javascript" src="<?php echo clean_url( site_url( 'wp-includes/js/tinymce/tiny_mce.js' ) ); ?>"></script> 707 <script type="text/javascript"> 708 /* <![CDATA[ */ 709 <?php 710 // Add TinyMCE languages 711 @include_once( ABSPATH . WPINC . '/js/tinymce/langs/wp-langs.php' ); 712 713 if ( isset($strings) ) 714 echo $strings; 715 716 ?> 717 (function() { 718 var base = tinymce.baseURL, sl = tinymce.ScriptLoader, ln = "<?php echo $language; ?>"; 719 720 sl.markDone(base + '/langs/' + ln + '.js'); 721 sl.markDone(base + '/themes/advanced/langs/' + ln + '.js'); 722 sl.markDone(base + '/themes/advanced/langs/' + ln + '_dlg.js'); 723 })(); 724 725 var wpTeenyMCEInit = function() { 726 tinyMCE.init({ 727 mode: "textareas", 728 editor_selector: "mceEditor", 729 language : "<?php echo $language; ?>", 730 width: "100%", 731 theme : "advanced", 732 theme_advanced_buttons1 : "<?php echo $args['buttons1']; ?>", 733 theme_advanced_buttons2 : "", 734 theme_advanced_buttons3 : "", 735 theme_advanced_toolbar_location : "top", 736 theme_advanced_toolbar_align : "left", 737 theme_advanced_statusbar_location : "bottom", 738 theme_advanced_resizing : true, 739 theme_advanced_resize_horizontal : false, 740 skin : "wp_theme", 741 dialog_type : "modal", 742 relative_urls : false, 743 remove_script_host : false, 744 convert_urls : false, 745 apply_source_formatting : false, 746 remove_linebreaks : false, 747 accessibility_focus : false, 748 tab_focus : ":next", 749 plugins : "safari,inlinepopups", 750 entities : "38,amp,60,lt,62,gt", 751 force_p_newlines : true 752 }); 753 }; 754 wpTeenyMCEInit(); 755 /* ]]> */ 756 </script> 757 758 <?php 759 } -
branches/crazyhorse/wp-admin/post.php
r8033 r8143 58 58 59 59 switch($action) { 60 case 'post-quickpress': 61 require_once(ABSPATH . 'wp-admin/includes/dashboard.php'); 62 add_filter( 'wp_dashboard_widgets', create_function( '$a', 'return array( "dashboard_quick_press" );' ) ); 63 wp_dashboard_setup(); 64 wp_dashboard(); 65 // no break 60 66 case 'postajaxpost': 61 67 case 'post': 62 68 check_admin_referer('add-post'); 63 69 64 $post_ID = 'post ' == $action ? write_post() : edit_post();70 $post_ID = 'postajaxpost' == $action ? edit_post() : write_post(); 65 71 66 redirect_post($post_ID); 72 if ( 'post-quickpress' !== $action ) 73 redirect_post($post_ID); 67 74 exit(); 68 75 break; -
branches/crazyhorse/wp-admin/press-this.php
r8116 r8143 234 234 <title><?php _e('Press This') ?></title> 235 235 236 <script type="text/javascript" src="../wp-includes/js/tinymce/tiny_mce.js"></script>237 236 <?php 238 237 add_thickbox(); 239 238 wp_enqueue_style('press-this'); 240 239 wp_enqueue_style( 'colors' ); 241 wp_enqueue_script('post'); 240 wp_enqueue_script( 'post' ); 241 242 wp_teeny_mce(); 242 243 243 244 do_action('admin_print_styles'); … … 245 246 do_action('admin_head'); 246 247 ?> 247 <script type="text/javascript"> 248 <?php if ( user_can_richedit() ) { 249 $language = ( '' == get_locale() ) ? 'en' : strtolower( substr(get_locale(), 0, 2) ); 250 // Add TinyMCE languages 251 @include_once( dirname(__FILE__).'/../wp-includes/js/tinymce/langs/wp-langs.php' ); 252 if ( isset($strings) ) echo $strings; ?> 253 (function() { 254 var base = tinymce.baseURL, sl = tinymce.ScriptLoader, ln = "<?php echo $language; ?>"; 255 256 sl.markDone(base + '/langs/' + ln + '.js'); 257 sl.markDone(base + '/themes/advanced/langs/' + ln + '.js'); 258 sl.markDone(base + '/themes/advanced/langs/' + ln + '_dlg.js'); 259 })(); 260 261 tinyMCE.init({ 262 mode: "textareas", 263 editor_selector: "mceEditor", 264 language : "<?php echo $language; ?>", 265 width: "100%", 266 theme : "advanced", 267 theme_advanced_buttons1 : "bold,italic,underline,blockquote,separator,strikethrough,bullist,numlist,undo,redo,link,unlink", 268 theme_advanced_buttons2 : "", 269 theme_advanced_buttons3 : "", 270 theme_advanced_toolbar_location : "top", 271 theme_advanced_toolbar_align : "left", 272 theme_advanced_statusbar_location : "bottom", 273 theme_advanced_resizing : true, 274 theme_advanced_resize_horizontal : false, 275 skin : "wp_theme", 276 dialog_type : "modal", 277 relative_urls : false, 278 remove_script_host : false, 279 convert_urls : false, 280 apply_source_formatting : false, 281 remove_linebreaks : false, 282 accessibility_focus : false, 283 tab_focus : ":next", 284 plugins : "safari,inlinepopups", 285 entities : "38,amp,60,lt,62,gt", 286 force_p_newlines : true 287 }); 288 <?php } ?> 289 290 jQuery('#tags-input').hide(); 248 <script type="text/javascript"> 249 jQuery('#tags-input').hide(); 291 250 292 251 tag_update_quickclicks();
Note: See TracChangeset
for help on using the changeset viewer.