Make WordPress Core

Changeset 9219


Ignore:
Timestamp:
10/16/2008 10:35:53 PM (16 years ago)
Author:
ryan
Message:

Dashboard updates from mdawaffe. see #7552

Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/css/dashboard.css

    r9121 r9219  
    109109}
    110110
     111/* QuickPress */
     112
     113#quick-press #add-media-button {
     114    margin: .5em 0;
     115}
     116
     117#quick-press #content-label {
     118    margin-top: 1em;
     119}
     120
     121#quick-press .textarea-wrap {
     122    clear: both;
     123}
     124
    111125/* Recent Drafts */
    112126#dashboard_recent_drafts ul {
     
    116130}
    117131
    118 /* Primary Feed */
     132/* Feeds */
    119133
    120 #dashboard_primary a.rsswidget, #dashboard_plugins h5 {
     134.rss-widget ul {
     135    margin: 0;
     136    padding: 0;
     137    list-style: none;
     138}
     139
     140.rss-widget a.rsswidget {
    121141    font-size: 14px;
    122142}
    123143
    124 #dashboard_primary span.rss-date {
     144.rss-widget span.rss-date {
    125145    font-size: 14px;
     146}
     147
     148.rss-widget cite {
     149    display: block;
     150    text-align: right;
     151    margin: 0 0 1em;
     152    padding: 0;
     153}
     154
     155.rss-widget cite:before {
     156    content: '\2014';
    126157}
    127158
     
    129160
    130161#dashboard_plugins h5 {
     162    font-size: 14px;
    131163    margin: 0;
    132164    display: inline;
  • trunk/wp-admin/includes/dashboard.php

    r9208 r9219  
    2929
    3030    // QuickPress Widget
    31     wp_add_dashboard_widget( 'dashboard_quick_press', __( 'QuickPress' ), 'wp_dashboard_quick_press', 'wp_dashboard_empty_control' );
     31    wp_add_dashboard_widget( 'dashboard_quick_press', __( 'QuickPress' ), 'wp_dashboard_quick_press' );
    3232
    3333    // Recent Drafts
     
    185185        </div>
    186186
    187         <h4><label for="quickpress-content"><?php _e('Post') ?></label></h4>
     187        <div id="add-media-button" class="alignright">
     188            <a class="thickbox button" href="http://hacek.local/wordpress/wp-admin/media-upload.php?TB_iframe=true" id="add-media-link"><?php _e( 'Insert Media' ); ?></a>
     189        </div>
     190
     191        <h4 id="content-label"><label for="content"><?php _e('Post') ?></label></h4>
    188192        <div class="textarea-wrap">
    189             <textarea name="content" id="quickpress-content" class="mceEditor" rows="3" cols="15"><?php echo $post->post_content; ?></textarea>
     193            <textarea name="content" id="content" class="mceEditor" rows="3" cols="15"><?php echo $post->post_content; ?></textarea>
    190194        </div>
    191195
     
    316320        $actions['spam'] = "<a href='$spam_url' class='delete:the-comment-list:comment-$comment->comment_ID::spam=1 vim-s vim-destructive' title='" . __( 'Mark this comment as spam' ) . "'>" . __( 'Spam' ) . '</a>';
    317321        $actions['delete'] = "<a href='$delete_url' class='delete:the-comment-list:comment-$comment->comment_ID delete vim-d vim-destructive'>" . __('Delete') . '</a>';
    318         $actions['reply'] = '<a onclick="commentReply.open(\''.$comment->comment_ID.'\',\''.$comment->comment_post_ID.'\');return false;" class="vim-r" title="'.__('Reply to this comment').'" href="#">' . __('Reply') . '</a>';
     322        $actions['quickedit'] = '<a onclick="commentReply.open(\''.$comment->comment_ID.'\',\''.$comment->comment_post_ID.'\',\'edit\');return false;" class="vim-q" title="'.__('Quick Edit').'" href="#">' . __('Quick Edit') . '</a>';
     323        $actions['reply'] = '<a onclick="commentReply.open(\''.$comment->comment_ID.'\',\''.$comment->comment_post_ID.'\');return false;" class="vim-r hide-if-no-js" title="'.__('Reply to this comment').'" href="#">' . __('Reply') . '</a>';
    319324
    320325        $actions = apply_filters( 'comment_row_actions', $actions, $comment );
     
    327332
    328333            // Reply and quickedit need a hide-if-no-js span
    329             if ( 'reply' == $action || 'quickedit' == $action )
     334            if ( 'reply' == $action )
    330335                $action .= ' hide-if-no-js';
     336            elseif ( 'quickedit' == $action )
     337                $action .= ' hide-if-no-js hide-if-js'; // hah
    331338
    332339            $actions_string .= "<span class='$action'>$sep$link</span>";
     
    362369            <blockquote><p><?php comment_excerpt(); ?></p></blockquote>
    363370            <p class="comment-actions"><?php echo $actions_string; ?></p>
     371
     372            <div id="inline-<?php echo $comment->comment_ID; ?>" class="hidden">
     373                <textarea class="comment"><?php echo $comment->comment_content; ?></textarea>
     374                <div class="author-email"><?php echo attribute_escape( $comment->comment_author_email ); ?></div>
     375                <div class="author"><?php echo attribute_escape( $comment->comment_author ); ?></div>
     376                <div class="author-url"><?php echo attribute_escape( $comment->comment_author_url ); ?></div>
     377                <div class="comment_status"><?php echo $comment->comment_approved; ?></div>
     378            </div>
     379
    364380        </div>
    365381<?php
     
    455471function wp_dashboard_rss_output( $widget_id ) {
    456472    $widgets = get_option( 'dashboard_widget_options' );
     473    echo "<div class='rss-widget'>";
    457474    wp_widget_rss_output( $widgets[$widget_id] );
     475    echo "</div>";
    458476}
    459477
     
    463481
    464482function wp_dashboard_secondary_control() {
    465     wp_dashboard_rss_control( 'dashboard_secondary', array( 'show_summary' => false, 'show_author' => false, 'show_date' => false ) );
     483    wp_dashboard_rss_control( 'dashboard_secondary' );
    466484}
    467485
     
    477495    @extract( @$widgets['dashboard_secondary'], EXTR_SKIP );
    478496    $rss = @fetch_rss( $url );
     497
    479498    if ( !isset($rss->items) || 0 == count($rss->items) )
    480499        return false;
    481500
    482     echo "<ul id='planetnews'>\n";
    483 
    484501    $rss->items = array_slice($rss->items, 0, $items);
    485     foreach ($rss->items as $item ) {
    486         $title = wp_specialchars($item['title']);
    487         list($author,$post) = explode( ':', $title, 2 );
    488         $link = clean_url($item['link']);
    489 
    490         echo "\t<li><a href='$link'><span class='post'>$post</span><span class='hidden'> - </span><cite>$author</cite></a></li>\n";
    491     }
    492 
    493     echo "</ul>\n<br class='clear' />\n";
     502
     503    if ( 'http://planet.wordpress.org/' == $rss->channel['link'] ) {
     504        foreach ( array_keys($rss->items) as $i ) {
     505            list($site, $description) = explode( ':', wp_specialchars($rss->items[$i]['title']), 2 );
     506            $rss->items[$i]['dc']['creator'] = trim($site);
     507            $rss->items[$i]['title'] = trim($description);
     508        }
     509    }
     510
     511    echo "<div class='rss-widget'>";
     512    wp_widget_rss_output( $rss, $widgets['dashboard_secondary'] );
     513    echo "</div>";
    494514}
    495515
     
    605625
    606626/* Dashboard Widgets Controls */
    607 
    608 // Temp
    609 function wp_dashboard_empty_control() {
    610     echo "This feature isn't enabled in this prototype.";
    611 }
    612627
    613628// Calls widget_control callback
  • trunk/wp-admin/index.php

    r9103 r9219  
    1717wp_enqueue_script( 'dashboard' );
    1818wp_enqueue_script( 'plugin-install' );
     19wp_enqueue_script( 'media-upload' );
    1920wp_admin_css( 'dashboard' );
    2021wp_admin_css( 'plugin-install' );
  • trunk/wp-admin/js/dashboard.js

    r9103 r9219  
     1var edCanvas;
     2
    13jQuery( function($) {
    24
     
    4345
    4446    $('#publish').click( function() { act.val( 'post-quickpress-publish' ); } );
     47
     48    edCanvas = jQuery('#content');
    4549};
    4650quickPressLoad();
  • trunk/wp-admin/js/edit-comments.js

    r9217 r9219  
    9090    init : function() {
    9191        this.rows = $('#the-comment-list tr');
     92        if ( !this.rows.size() )
     93            this.rows = $('#the-comment-list > div.comment-item');
    9294        var row = $('#replyrow');
    9395
  • trunk/wp-admin/js/media-upload.js

    r8600 r9219  
    1010
    1111        ed.execCommand('mceInsertContent', false, h);
    12     } else
     12    } else if ( jQuery.isFunction( 'edInsertContent' ) ) {
    1313        edInsertContent(edCanvas, h);
     14    } else {
     15        jQuery( edCanvas ).val( jQuery( edCanvas ).val() + h );
     16    }
    1417
    1518    tb_remove();
  • trunk/wp-includes/widgets.php

    r9088 r9219  
    15821582                $title = __('Untitled');
    15831583            $desc = '';
    1584             $summary = '';
    15851584            if ( isset( $item['description'] ) && is_string( $item['description'] ) )
    1586                 $desc = $summary = str_replace(array("\n", "\r"), ' ', attribute_escape(strip_tags(html_entity_decode($item['description'], ENT_QUOTES))));
     1585                $desc = str_replace(array("\n", "\r"), ' ', attribute_escape(strip_tags(html_entity_decode($item['description'], ENT_QUOTES))));
    15871586            elseif ( isset( $item['summary'] ) && is_string( $item['summary'] ) )
    1588                 $desc = $summary = str_replace(array("\n", "\r"), ' ', attribute_escape(strip_tags(html_entity_decode($item['summary'], ENT_QUOTES))));
     1587                $desc = str_replace(array("\n", "\r"), ' ', attribute_escape(strip_tags(html_entity_decode($item['summary'], ENT_QUOTES))));
     1588            if ( 360 < strlen( $desc ) )
     1589                $desc = substr( $desc, 0, 360 ) . ' [&hellip;]';
     1590            $summary = $desc;
    15891591
    15901592            if ( $show_summary ) {
Note: See TracChangeset for help on using the changeset viewer.