Make WordPress Core

Changeset 8371


Ignore:
Timestamp:
07/18/2008 10:10:41 AM (15 years ago)
Author:
azaozz
Message:

crazyhorse: fixed toolbar on write post screen, sortables js improvements, no redirect after publishing post

Location:
branches/crazyhorse/wp-admin
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • branches/crazyhorse/wp-admin/admin-footer.php

    r8115 r8371  
    1 <br class="clear" /></div></div><!-- wpbody-content wpbody -->
    2 <br class="clear" /></div><!-- wpcontent -->
     1</div><!-- wpbody-content -->
     2<?php if ( ! $fixed_bar ) { ?>
     3</div><!-- wpbody -->
     4<?php } ?>
     5</div><!-- wpcontent -->
    36</div><!-- wpwrap -->
     7
    48<div id="footer">
    59<p><?php
  • branches/crazyhorse/wp-admin/admin-header.php

    r8335 r8371  
    1616        add_filter( 'admin_body_class', 'add_minwidth' );
    1717}
     18
     19$fixed_bar_pages = array( 'post.php', 'post-new.php' );
     20$fixed_bar = in_array( $the_current_page, $fixed_bar_pages ) ? true : false;
    1821
    1922get_admin_page_title();
     
    120123}
    121124?>
    122 <div id="wpbody"><div id="wpbody-content">
     125<div id="wpbody">
     126
     127<?php if ( ! $fixed_bar ) { ?>
     128<div id="wpbody-content">
     129<?php } ?>
  • branches/crazyhorse/wp-admin/css/colors-fresh.css

    r8335 r8371  
    1 #wpcontent {
     1#wpcontent, #wpbody {
    22    background-color: #e4f2fd;
    33}
     
    708708    background-color: #99ff99;
    709709}
     710
     711
     712
     713
     714#adminmenu {
     715    background-color: #E4F2FD;
     716}
     717
     718
     719/* fixed tool bar */
     720#fixedbar {
     721    background-color:#464646;
     722    color: #ccc;
     723}
     724
     725#fixedbar #last-edit {
     726   
     727}
     728
     729#fixedbar a,
     730#fixedbar .curtime {
     731    color: #ccc;
     732}
     733
     734#fixedbar a:hover {
     735    color: #fff;
     736}
     737
     738#fixedbar a.button {
     739    color: #246;
     740}
     741
     742#fixedbar a.button:hover {
     743    color: #d54e21;
     744}
     745
     746#timestampdiv {
     747    color: #ccc;
     748}
  • branches/crazyhorse/wp-admin/css/dashboard.css

    r8292 r8371  
    2020    border-style: solid;
    2121    border-width: 1px;
    22     padding: 0;
     22    padding: 2px;
    2323    border-color: #CCCCCC;
    2424}
     
    2626form .textarea-wrap textarea {
    2727    border: 0pt none;
     28    padding: 0;
     29    width: 100%;
    2830}
    2931
  • branches/crazyhorse/wp-admin/edit-form-advanced.php

    r8329 r8371  
    99$messages[4] = __('Post updated.');
    1010$messages[5] = sprintf( __('Post restored to revision from %s'), wp_post_revision_title( $_GET['revision'], false ) );
     11$messages[6] = __('Post published.');
    1112
    1213$notice = false;
     
    3738
    3839?>
    39 <?php if ( $notice ) : ?>
    40 <div id="notice" class="error"><p><?php echo $notice ?></p></div>
    41 <?php endif; ?>
    42 <?php if (isset($_GET['message'])) : ?>
    43 <div id="message" class="updated fade"><p><?php echo $messages[$_GET['message']]; ?></p></div>
    44 <?php endif; ?>
     40
    4541
    4642<?php
     
    232228
    233229<form name="post" action="post.php" method="post" id="post">
     230<div id="wpbody-content">
     231
     232<?php if ( $notice ) : ?>
     233<div id="notice" class="error"><p><?php echo $notice ?></p></div>
     234<?php endif; ?>
     235<?php if (isset($_GET['message'])) : ?>
     236<div id="message" class="updated fade"><p><?php echo $messages[$_GET['message']]; ?></p></div>
     237<?php endif; ?>
     238
    234239<?php if ( (isset($mode) && 'bookmarklet' == $mode) || isset($_GET['popupurl']) ): ?>
    235240<input type="hidden" name="mode" value="bookmarklet" />
     
    244249?></h2>
    245250
    246 <p id="big-add-button">
     251<!--<p id="big-add-button">
    247252<span id="previewview">
    248253<?php if ( 'publish' == $post->post_status ) { ?>
     
    252257<?php } ?>
    253258</span>
    254 </p>
     259</p>-->
    255260
    256261<?php
     
    344349<div id="post-status-info">
    345350    <span id="wp-word-count" class="alignleft"></span>
    346     <span id="autosave" class="alignright"></span>
     351    <span class="alignright">
     352    <span id="autosave">&nbsp;</span>
     353<?php
     354    if ( $post_ID ) {
     355        echo '<span id="last-edit">';
     356        if ( $last_id = get_post_meta($post_ID, '_edit_last', true) ) {
     357            $last_user = get_userdata($last_id);
     358            printf(__('Last edited by %1$s on %2$s at %3$s'), wp_specialchars( $last_user->display_name ), mysql2date(get_option('date_format'), $post->post_modified), mysql2date(get_option('time_format'), $post->post_modified));
     359        } else {
     360            printf(__('Last edited on %1$s at %2$s'), mysql2date(get_option('date_format'), $post->post_modified), mysql2date(get_option('time_format'), $post->post_modified));
     361        }
     362        echo '</span>';
     363    }
     364?>
     365    </span>
    347366    <br class="clear" />
    348367</div>
    349368
    350 <div id="submitpost" class="submitbox">
     369
     370<?php wp_nonce_field( 'autosave', 'autosavenonce', false ); ?>
     371<?php wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false ); ?>
     372<?php wp_nonce_field( 'getpermalink', 'getpermalinknonce', false ); ?>
     373<?php wp_nonce_field( 'samplepermalink', 'samplepermalinknonce', false ); ?>
     374<?php wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false ); ?>
     375</div>
     376
     377<?php
     378
     379echo $form_pingback;
     380echo $form_prevstatus;
     381
     382do_meta_boxes('post', 'normal', $post);
     383
     384do_action('edit_form_advanced');
     385
     386do_meta_boxes('post', 'advanced', $post);
     387
     388do_action('dbx_post_sidebar');
     389
     390?>
     391
     392</div>
     393</div>
     394</div><!-- /poststuff -->
     395
     396</div>
     397</div>
     398
     399<div id="fixedbar">
     400<table id="fixedbar-wrap"><tbody><tr>
     401<td id="preview-link">&nbsp;
     402<?php if ( 'publish' == $post->post_status ) { ?>
     403<a href="<?php echo clean_url(get_permalink($post->ID)); ?>" target="_blank" tabindex="4"><?php _e('View this Post'); ?></a>
     404<?php } elseif ( 'edit' == $action ) { ?>
     405<a href="<?php echo clean_url(apply_filters('preview_post_link', add_query_arg('preview', 'true', get_permalink($post->ID)))); ?>" target="_blank"  tabindex="4"><?php _e('Preview this Post'); ?></a>
     406<?php } ?>
     407</td>
     408<td id="submitpost" class="submitbox">
    351409<div id="post-time-info" class="alignleft">
    352410<?php
    353411    if ( current_user_can( 'publish_posts' ) ) : // Contributors don't get to choose the date of publish
    354412        $stamp = __( 'Timestamp: <span class="timestamp">%1$s%3$s</span>' );
    355         $edit = '&nbsp;<a href="#edit_timestamp" class="edit-timestamp hide-if-no-js" tabindex="4">' . __('(Change)') . '</a>';
     413        $edit = '&nbsp;(<a href="#edit_timestamp" class="edit-timestamp hide-if-no-js" tabindex="4">' . __('Change') . '</a>)';
    356414        if ($post_ID) {
    357415            if ( '0000-00-00 00:00:00' == $post->post_date ) { // draft, 1 or more saves, no date specified
     
    370428?>
    371429
    372     <p class="curtime"><?php printf($stamp, $date, $time, $edit); ?>
    373 </p>
     430    <p class="curtime"><?php printf($stamp, $date, $time, $edit); ?></p>
    374431    <div id='timestampdiv' class='hide-if-js'><?php touch_time(($action == 'edit'),1,4); ?></div>
    375432
    376433<?php
    377 
    378434    endif;
    379 
    380     if ( $post_ID ) {
    381         echo '<p id="last-edit">';
    382         if ( $last_id = get_post_meta($post_ID, '_edit_last', true) ) {
    383             $last_user = get_userdata($last_id);
    384             printf(__('Last edited by %1$s on %2$s at %3$s'), wp_specialchars( $last_user->display_name ), mysql2date(get_option('date_format'), $post->post_modified), mysql2date(get_option('time_format'), $post->post_modified));
    385         } else {
    386             printf(__('Last edited on %1$s at %2$s'), mysql2date(get_option('date_format'), $post->post_modified), mysql2date(get_option('time_format'), $post->post_modified));
    387         }
    388         echo '</p>';
    389     }
    390 
    391 ?>
    392 
     435?>
    393436</div>
    394437<p class="submit alignright">
     
    409452    <input name="publish" type="submit" class="button" id="publish" tabindex="5" accesskey="p" value="<?php _e('Publish') ?>" />
    410453
    411 <?php       else : ?>
     454<?php   else : ?>
    412455
    413456    <input name="publish" type="submit" class="button" id="publish" tabindex="5" accesskey="p" value="<?php _e('Submit for Review') ?>" />
     
    420463?>
    421464</p>
    422 <br class="clear" />
    423 </div>
    424 
    425 <?php wp_nonce_field( 'autosave', 'autosavenonce', false ); ?>
    426 <?php wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false ); ?>
    427 <?php wp_nonce_field( 'getpermalink', 'getpermalinknonce', false ); ?>
    428 <?php wp_nonce_field( 'samplepermalink', 'samplepermalinknonce', false ); ?>
    429 <?php wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false ); ?>
    430 </div>
    431 
    432 <?php
    433 
    434 echo $form_pingback;
    435 echo $form_prevstatus;
    436 
    437 do_meta_boxes('post', 'normal', $post);
    438 
    439 do_action('edit_form_advanced');
    440 
    441 do_meta_boxes('post', 'advanced', $post);
    442 
    443 do_action('dbx_post_sidebar');
    444 
    445 ?>
    446 
    447 </div>
    448 </div>
    449 </div>
    450 
     465</td></tr></tbody></table>
    451466</div>
    452467
  • branches/crazyhorse/wp-admin/includes/template.php

    r8339 r8371  
    12411241        foreach ( array('high', 'sorted', 'core', 'default', 'low') as $priority ) {
    12421242            foreach ( (array) $wp_meta_boxes[$page][$context][$priority] as $box ) {
    1243                 if ( false === $box )
     1243                if ( false == $box || ! $box['title'] )
    12441244                    continue;
    12451245                $i++;
    12461246                echo '<div id="' . $box['id'] . '" class="postbox ' . postbox_classes($box['id'], $page) . '">' . "\n";
    1247                 echo "<h3>{$box['title']}</h3>\n";
     1247                echo "<h3><span class='hndle'>{$box['title']}</span></h3>\n";
    12481248                echo '<div class="inside">' . "\n";
    12491249                call_user_func($box['callback'], $object, $box);
  • branches/crazyhorse/wp-admin/js/comment.js

    r8300 r8371  
    11jQuery(document).ready( function() {
    2     add_postbox_toggles('comment');
     2    postboxes.add_postbox_toggles('comment');
    33
    44    // close postboxes that should be closed
  • branches/crazyhorse/wp-admin/js/common.js

    r8268 r8371  
    2626
    2727            el.mouseover(function(e) {
    28                 txt = el.attr('tip'), o = el.offset();;
     28                txt = el.attr('tip'), o = el.offset();
    2929
    3030                clearTimeout(TT.sD);
     
    5151    // Temp
    5252    if ( !$('#post-search, #widget-search').size() ) {
    53         $('.wrap:first').append( '<p id="post-search"><input id="post-search-input" type="text" /><input class="button" type="button" value="Search" /></p>' );
     53        $('#wphead').append( '<p id="post-search-prep"><input id="post-search-input" type="text" /><input class="button" type="button" value="Search" /></p>' );
    5454    }
     55   
     56    // Temp 2
     57    var minH = $(window).height()-185+"px"
     58    $('#wpbody-content').css("min-height", minH);
     59
    5560
    5661} );
  • branches/crazyhorse/wp-admin/js/link.js

    r8026 r8371  
    55    jQuery('#link_name').focus();
    66    // postboxes
    7     add_postbox_toggles('link');
     7    postboxes.add_postbox_toggles('link');
    88
    99    // category tabs
  • branches/crazyhorse/wp-admin/js/page.js

    r7529 r8371  
    11jQuery(document).ready( function() {
    2     add_postbox_toggles('page');
     2    postboxes.add_postbox_toggles('page');
    33    make_slugedit_clickable();
    44
  • branches/crazyhorse/wp-admin/js/post.js

    r8286 r8371  
    7070
    7171    // postboxes
    72     add_postbox_toggles('post');
     72    postboxes.add_postbox_toggles('post');
    7373
    7474    // Editable slugs
     
    162162    jQuery('.edit-timestamp').click(function () {
    163163        if (jQuery('#timestampdiv').is(":hidden")) {
     164            jQuery('.curtime').slideUp("normal");
    164165            jQuery('#timestampdiv').slideDown("normal");
    165             jQuery('.timestamp').hide();
     166    //      jQuery('.timestamp').hide();
    166167        } else {
    167             jQuery('#timestampdiv').hide();
     168            jQuery('#timestampdiv').slideUp("normal");
    168169            jQuery('#mm').val(jQuery('#hidden_mm').val());
    169170            jQuery('#jj').val(jQuery('#hidden_jj').val());
     
    171172            jQuery('#hh').val(jQuery('#hidden_hh').val());
    172173            jQuery('#mn').val(jQuery('#hidden_mn').val());
    173             jQuery('.timestamp').show();
     174            jQuery('.curtime').slideDown("normal");
     175        //  jQuery('.timestamp').show();
    174176        }
    175177        return false;
     
    186188            jQuery('#mn').val() + ' '
    187189        ).append( link );
     190        jQuery('.curtime').slideDown("normal");
    188191        return false;
    189192    });
  • branches/crazyhorse/wp-admin/js/postbox.js

    r8291 r8371  
    1 function add_postbox_toggles(page) {
    2     jQuery('.postbox h3').before('<a class="togbox">+</a> ');
    3     jQuery('.postbox a.togbox').click( function() { jQuery(jQuery(this).parent().get(0)).toggleClass('closed'); save_postboxes_state(page); } );
    41
    5     jQuery('#side-sortables').append( '<div id="make-it-tall" style="margin-bottom: -2000px; padding-bottom: 2001px"></div>' );
    6     jQuery('#wpbody-content').css( 'overflow', 'hidden' );
     2(function($) {
     3    postboxes = {
     4        add_postbox_toggles : function(page) {
     5            $('.postbox h3').before('<a class="togbox">+</a> ');
     6            $('.postbox h3, .postbox a.togbox').click( function() { $($(this).parent().get(0)).toggleClass('closed'); save_postboxes_state(page); } );
     7       
     8            $('#side-sortables').append( '<div id="make-it-tall" style="margin-bottom: -2000px; padding-bottom: 2001px"></div>' );
     9            $('#wpbody-content').css( 'overflow', 'hidden' );
     10           
     11            this.init(page);
     12        },
     13   
     14        expandSidebar : function( doIt ) {
     15            if ( doIt || $.trim( $( '#side-info-column' ).text() ) ) {
     16                $( '#post-body' ).addClass( 'has-sidebar' );
     17                $( '#side-sortables' ).css('z-index','0');
     18            } else {
     19                $( '#post-body' ).removeClass( 'has-sidebar' );
     20                $( '#side-sortables' ).css('z-index','-1');
     21            }
     22        },
    723
    8     var expandSidebar = function( doIt ) {
    9         if ( doIt || jQuery.trim( jQuery( '#side-info-column' ).text() ) ) {
    10             jQuery( '#post-body' ).addClass( 'has-sidebar' );
    11         } else {
    12             jQuery( '#post-body' ).removeClass( 'has-sidebar' );
     24        init : function(page) {
     25            jQuery('.meta-box-sortables').sortable( {
     26                connectWith: [ '.meta-box-sortables' ],
     27                items: '> .postbox',
     28                handle: '.hndle',
     29                stop: function() {
     30                    if ( 'side-sortables' == this.id ) { // doing this with jQuery doesn't work for some reason: make-it-tall gets duplicated
     31                        var makeItTall = document.getElementById( 'make-it-tall' );
     32                        var sideSort = makeItTall.parentNode;
     33                        sideSort.removeChild( makeItTall );
     34                        sideSort.appendChild( makeItTall );
     35                       
     36                    }
     37                    var postVars = {
     38                        action: 'meta-box-order',
     39                        _ajax_nonce: jQuery('#meta-box-order-nonce').val(),
     40                        page: page
     41                    }
     42                    jQuery('.meta-box-sortables').each( function() {
     43                        postVars["order[" + this.id.split('-')[0] + "]"] = jQuery(this).sortable( 'toArray' ).join(',');
     44                    } );
     45                    jQuery.post( postboxL10n.requestFile, postVars, function() {
     46                        postboxes.expandSidebar();
     47                    } );
     48                },
     49                over: function(e, ui) {
     50                    if ( !ui.element.is( '#side-sortables' ) )
     51                        return;
     52                    postboxes.expandSidebar( true );
     53                }
     54            } );
    1355        }
    14     };
     56    }
     57}(jQuery));
    1558
    16     var postingMetaBox = false; // post once, not once per sortable
    17     jQuery('.meta-box-sortables').sortable( {
    18         connectWith: [ '.meta-box-sortables' ],
    19         items: '> .postbox',
    20         handle: 'h3',
    21         update: function() {
    22             if ( 'side-sortables' == this.id ) { // doing this with jQuery doesn't work for some reason: make-it-tall gets duplicated
    23                 var makeItTall = document.getElementById( 'make-it-tall' );
    24                 var sideSort = makeItTall.parentNode;
    25                 sideSort.removeChild( makeItTall );
    26                 sideSort.appendChild( makeItTall );
    27                
    28             }
    29             if ( postingMetaBox ) {
    30                 return;
    31             }
    32             postingMetaBox = true;
    33             var postVars = {
    34                 action: 'meta-box-order',
    35                 _ajax_nonce: jQuery('#meta-box-order-nonce').val(),
    36                 page: page
    37             }
    38             jQuery('.meta-box-sortables').each( function() {
    39                 postVars["order[" + this.id.split('-')[0] + "]"] = jQuery(this).sortable( 'toArray' ).join(',');
    40             } );
    41             jQuery.post( postboxL10n.requestFile, postVars, function() {
    42                 postingMetaBox = false;
    43                 expandSidebar();
    44             } );
    45         },
    46         over: function(e, ui) {
    47             if ( !ui.element.is( '#side-sortables' ) )
    48                 return;
    49             expandSidebar( true );
    50         }
    51     } );
    52 }
     59jQuery(document).ready(function(){postboxes.expandSidebar();});
    5360
    5461function save_postboxes_state(page) {
  • branches/crazyhorse/wp-admin/post.php

    r8150 r8371  
    2121    } elseif ( !empty($_POST['mode']) && 'sidebar' == $_POST['mode'] ) {
    2222        $location = 'sidebar.php?a=b';
    23     } elseif ( isset($_POST['save']) && ( empty($referredby) || $referredby == $referer || 'redo' != $referredby ) ) {
     23    } elseif ( ( isset($_POST['save']) || isset($_POST['publish']) ) && ( empty($referredby) || $referredby == $referer || 'redo' != $referredby ) ) {
    2424        if ( $_POST['_wp_original_http_referer'] && strpos( $_POST['_wp_original_http_referer'], '/wp-admin/post.php') === false && strpos( $_POST['_wp_original_http_referer'], '/wp-admin/post-new.php') === false )
    2525            $location = add_query_arg( '_wp_original_http_referer', urlencode( stripslashes( $_POST['_wp_original_http_referer'] ) ), "post.php?action=edit&post=$post_ID&message=1" );
    2626        else
    27             $location = "post.php?action=edit&post=$post_ID&message=4";
     27            $location = "post.php?action=edit&post=$post_ID&message=6";
    2828    } elseif (isset($_POST['addmeta']) && $_POST['addmeta']) {
    2929        $location = add_query_arg( 'message', 2, wp_get_referer() );
  • branches/crazyhorse/wp-admin/wp-admin.css

    r8335 r8371  
    986986
    987987.submitbox {
    988     margin: 1em 0;
     988/*  margin: 1em 0; */
    989989}
    990990
     
    12521252    margin-bottom: 8px;
    12531253    margin-right: 3px;
    1254     padding: 6px 4px;
    1255     border: none;
     1254    padding: 6px;
    12561255}
    12571256
     
    13781377
    13791378p#post-search {
    1380         position: absolute;
    1381         right: 0;
    1382         top: -64px;
    1383         margin: 0;
     1379    position: absolute;
     1380    right: 0;
     1381    top: -64px;
     1382    margin: 0;
    13841383}
    13851384
     
    16531652    padding: 1em .5em;
    16541653}
     1654
     1655.hndle {
     1656    cursor:move;
     1657    padding:6px 10px 6px 0pt;
     1658}
     1659
     1660a.togbox {
     1661    cursor: pointer;
     1662}
     1663
     1664
     1665/* fixed bottom bar */
     1666.postarea h3 label {
     1667    float:none;
     1668}
     1669
     1670#fixedbar {
     1671    bottom:0pt;
     1672    height:80px;
     1673    position:fixed;
     1674    width:100%;
     1675    z-index: 100;
     1676}
     1677
     1678#fixedbar #submitpost {
     1679    width: 690px;
     1680}
     1681
     1682#fixedbar .submit {
     1683    padding-top: 10px;
     1684}
     1685
     1686#fixedbar .button {
     1687    border: 1px solid #464646;
     1688}
     1689
     1690#fixedbar .button:hover {
     1691    border: 1px solid #000;
     1692}
     1693
     1694#fixedbar #publish {
     1695    font-weight:bold;
     1696    width:160px;
     1697}
     1698
     1699#fixedbar #save-post {
     1700    width:80px;
     1701    font-weight:normal;
     1702}
     1703
     1704#fixedbar .submitbox {
     1705    padding: 14px 18px;
     1706    border-left: 1px solid #aaa;
     1707}
     1708
     1709#fixedbar #post-time-info {
     1710    margin-top: 17px;
     1711}
     1712
     1713#fixedbar #timestampdiv input,
     1714#fixedbar #timestampdiv select {
     1715    background-color:#464646;
     1716    border:1px solid #777777;
     1717    color:#CCCCCC;
     1718    padding:2px;
     1719}
     1720
     1721#fixedbar-wrap {
     1722    width: 100%;
     1723}
     1724
     1725#preview-link {
     1726    text-align: right;
     1727}
     1728
     1729#preview-link a {
     1730    padding-right:10px;
     1731}
     1732
     1733p#post-search-prep {
     1734    margin:0pt;
     1735    position:absolute;
     1736    right:20px;
     1737    top:50px;
     1738}
     1739
     1740#jj, #hh, #mn {
     1741    width: 1.5em;
     1742}
     1743
     1744#aa {
     1745    width: 2.7em;
     1746}
     1747
     1748
     1749
     1750
     1751
     1752
     1753
Note: See TracChangeset for help on using the changeset viewer.