Make WordPress Core

Ticket #18306: 18306.10.diff

File 18306.10.diff, 7.1 KB (added by helenyhou, 12 years ago)
  • wp-includes/js/autosave.js

     
    205205
    206206function autosave_update_slug(post_id) {
    207207        // create slug area only if not already there
    208         if ( 'undefined' != makeSlugeditClickable && jQuery.isFunction(makeSlugeditClickable) && !jQuery('#edit-slug-box > *').size() ) {
     208        if ( !jQuery('#edit-slug-box > *').size() ) {
    209209                jQuery.post( ajaxurl, {
    210210                                action: 'sample-permalink',
    211211                                post_id: post_id,
     
    215215                        function(data) {
    216216                                if ( data !== '-1' ) {
    217217                                        jQuery('#edit-slug-box').html(data);
    218                                         makeSlugeditClickable();
    219218                                }
    220219                        }
    221220                );
  • wp-admin/includes/post.php

     
    10731073        }
    10741074
    10751075        if ( false === strpos($permalink, '%postname%') && false === strpos($permalink, '%pagename%') ) {
     1076                if ( isset( $view_post ) )
     1077                        $permalink = '<a href="' . $permalink . '" title="' . esc_attr( $view_post ) . '" target="_blank">' . $permalink . '</a>';
    10761078                $return = '<strong>' . __('Permalink:') . "</strong>\n" . '<span id="sample-permalink" tabindex="-1">' . $permalink . "</span>\n";
    10771079                if ( '' == get_option( 'permalink_structure' ) && current_user_can( 'manage_options' ) && !( 'page' == get_option('show_on_front') && $id == get_option('page_on_front') ) )
    10781080                        $return .= '<span id="change-permalinks"><a href="options-permalink.php" class="button button-small" target="_blank">' . __('Change Permalinks') . "</a></span>\n";
    1079                 if ( isset($view_post) )
    1080                         $return .= "<span id='view-post-btn'><a href='$permalink' class='button button-small'>$view_post</a></span>\n";
    10811081
    10821082                $return = apply_filters('get_sample_permalink_html', $return, $id, $new_title, $new_slug);
    10831083
     
    10981098                }
    10991099        }
    11001100
    1101         $post_name_html = '<span id="editable-post-name" title="' . $title . '">' . $post_name_abridged . '</span>';
     1101        $post_name_html = '<span id="editable-post-name">' . $post_name_abridged . '</span>';
    11021102        $display_link = str_replace(array('%pagename%','%postname%'), $post_name_html, $permalink);
    11031103        $view_link = str_replace(array('%pagename%','%postname%'), $post_name, $permalink);
     1104        if ( isset( $view_post ) )
     1105                $display_link = '<a href="' . $view_link . '" title="' . esc_attr( $view_post ) . '" target="_blank">' . $display_link . '</a>';
    11041106        $return =  '<strong>' . __('Permalink:') . "</strong>\n";
    11051107        $return .= '<span id="sample-permalink" tabindex="-1">' . $display_link . "</span>\n";
    11061108        $return .= '&lrm;'; // Fix bi-directional text display defect in RTL languages.
    11071109        $return .= '<span id="edit-slug-buttons"><a href="#post_name" class="edit-slug button button-small hide-if-no-js" onclick="editPermalink(' . $id . '); return false;">' . __('Edit') . "</a></span>\n";
    11081110        $return .= '<span id="editable-post-name-full">' . $post_name . "</span>\n";
    1109         if ( isset($view_post) )
    1110                 $return .= "<span id='view-post-btn'><a href='$view_link' class='button button-small'>$view_post</a></span>\n";
    11111111
    11121112        $return = apply_filters('get_sample_permalink_html', $return, $id, $new_title, $new_slug);
    11131113
  • wp-admin/js/post.js

     
    1 var tagBox, commentsBox, editPermalink, makeSlugeditClickable, WPSetThumbnailHTML, WPSetThumbnailID, WPRemoveThumbnail, wptitlehint;
     1var tagBox, commentsBox, editPermalink, WPSetThumbnailHTML, WPSetThumbnailID, WPRemoveThumbnail, wptitlehint;
    22
    33// return an array with any duplicate, whitespace or values removed
    44function array_unique_noempty(a) {
     
    562562        // permalink
    563563        if ( $('#edit-slug-box').length ) {
    564564                editPermalink = function(post_id) {
    565                         var i, c = 0, e = $('#editable-post-name'), revert_e = e.html(), real_slug = $('#post_name'), revert_slug = real_slug.val(), b = $('#edit-slug-buttons'), revert_b = b.html(), full = $('#editable-post-name-full').html();
     565                        var i, c = 0, e = $('#editable-post-name'), real_slug = $('#post_name'), revert_slug = real_slug.val(), b = $('#edit-slug-buttons'), revert_b = b.html(), full = $('#editable-post-name-full').html(), s = $('#sample-permalink'), revert_s = s.html();
    566566
    567567                        $('#view-post-btn').hide();
    568568                        b.html('<a href="#" class="save button button-small">'+postL10n.ok+'</a> <a class="cancel" href="#">'+postL10n.cancel+'</a>');
     
    581581                                        $('#edit-slug-box').html(data);
    582582                                        b.html(revert_b);
    583583                                        real_slug.val(new_slug);
    584                                         makeSlugeditClickable();
    585584                                        $('#view-post-btn').show();
    586585                                });
    587586                                return false;
     
    589588
    590589                        $('.cancel', '#edit-slug-buttons').click(function() {
    591590                                $('#view-post-btn').show();
    592                                 e.html(revert_e);
     591                                s.html(revert_s);
    593592                                b.html(revert_b);
    594593                                real_slug.val(revert_slug);
    595594                                return false;
     
    601600                        }
    602601
    603602                        slug_value = ( c > full.length / 4 ) ? '' : full;
     603                        e.parent('a').contents().unwrap();
    604604                        e.html('<input type="text" id="new-post-slug" value="'+slug_value+'" />').children('input').keypress(function(e){
    605605                                var key = e.keyCode || 0;
    606606                                // on enter, just save the new slug, don't save the post
     
    615615                                real_slug.val(this.value);
    616616                        }).focus();
    617617                }
    618 
    619                 makeSlugeditClickable = function() {
    620                         $('#editable-post-name').click(function() {
    621                                 $('#edit-slug-buttons').children('.edit-slug').click();
    622                         });
    623                 }
    624                 makeSlugeditClickable();
    625618        }
    626619
    627620        // word count
  • wp-admin/css/colors-fresh.css

     
    713713#media-items a.delete,
    714714#media-items a.delete-permanently,
    715715.plugins a.delete,
    716 .ui-tabs-nav a {
     716.ui-tabs-nav a,
     717#sample-permalink a:hover {
    717718        color: #21759b;
    718719}
    719720
     
    757758        background-color: #ddd;
    758759}
    759760
    760 #editable-post-name {
    761         background-color: #fffbcc;
    762 }
    763 
    764761#edit-slug-box strong,
    765762.tablenav .displaying-num,
    766763#submitted-on,
  • wp-admin/css/wp-admin.css

     
    29212921        font-size: 11px;
    29222922}
    29232923
     2924#editable-post-name {
     2925        font-weight: bold;
     2926}
     2927
     2928#sample-permalink a {
     2929        text-decoration: none;
     2930}
     2931
     2932#sample-permalink a:hover {
     2933        text-decoration: underline;
     2934}
     2935
    29242936#editable-post-name-full {
    29252937        display: none;
    29262938}
    29272939
    29282940#editable-post-name input {
    29292941        width: 16em;
     2942        font-weight: normal;
    29302943}
    29312944
    29322945.postarea h3 label {
  • wp-admin/css/colors-classic.css

     
    722722#media-items a.delete,
    723723#media-items a.delete-permanently,
    724724.plugins a.delete,
    725 .ui-tabs-nav a {
     725.ui-tabs-nav a,
     726#sample-permalink a:hover {
    726727        color: #21759b;
    727728}
    728729
     
    766767        background-color: #ddd;
    767768}
    768769
    769 #editable-post-name {
    770         background-color: #fffbcc;
    771 }
    772 
    773770#edit-slug-box strong,
    774771.tablenav .displaying-num,
    775772#submitted-on,