WordPress.org

Make WordPress Core

Changeset 6794


Ignore:
Timestamp:
02/11/2008 11:19:09 PM (12 years ago)
Author:
ryan
Message:

Use full slug, not abbreviated slug, when editing. Props nbachiyski. fixes #5816

Location:
trunk/wp-admin
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/post.php

    r6761 r6794  
    556556        return '';
    557557    }
    558     $title = __('You can edit this part of the permalink using the Edit button on the right');
     558    $title = __('Click to edit this part of the permalink');
    559559    if (strlen($post_name) > 30) {
    560         $post_name = substr($post_name, 0, 14). '…' . substr($post_name, -14);
    561     }
    562     $post_name_html = '<span id="editable-post-name" title="'.$title.'">'.$post_name.'</span>';
     560        $post_name_abridged = substr($post_name, 0, 14). '&hellip;' . substr($post_name, -14);
     561    } else {
     562        $post_name_abridged = $post_name;
     563    }
     564    $post_name_html = '<span id="editable-post-name" title="'.$title.'">'.$post_name_abridged.'</span><span id="editable-post-name-full">'.$post_name.'</span>';
    563565    $display_link = str_replace('%postname%', $post_name_html, $permalink);
    564566    return $display_link;
  • trunk/wp-admin/js/slug.js

    r6788 r6794  
    44    var revert_e = e.html();   
    55    var real_slug = jQuery('#post_name');
     6    var revert_slug = real_slug.html();
    67    var b = jQuery('#edit-slug-buttons');
    78    var revert_b = b.html();
    8     var old_slug = e.children('span').html();
     9    var full = jQuery('#editable-post-name-full').html();
    910
    1011    b.html('<a href="" class="save">'+slugL10n.save+'</a> <a class="cancel" href="">'+slugL10n.cancel+'</a>');
     
    2627        e.html(revert_e);
    2728        b.html(revert_b);
    28         real_slug.attr('value', revert_e);
     29        real_slug.attr('value', revert_slug);
    2930        return false;
    3031    });
    31     for(i=0; i < revert_e.length; ++i) {
    32         if ('%' == revert_e.charAt(i)) c++;
     32    for(i=0; i < full.length; ++i) {
     33        if ('%' == full.charAt(i)) c++;
    3334    }
    34     slug_value = (c > revert_e.length/4)? '' : revert_e;
     35    slug_value = (c > full.length/4)? '' : full;
    3536    e.html('<input type="text" id="new-post-slug" value="'+slug_value+'" />').children('input').keypress(function(e){
    3637        var key = e.charCode ? e.charCode : e.keyCode ? e.keyCode : 0;
  • trunk/wp-admin/wp-admin.css

    r6781 r6794  
    10541054#edit-slug-box strong {color: #777;}
    10551055#editable-post-name {background-color: #FFFBCC;}
     1056#editable-post-name-full {display: none;}
    10561057#editable-post-name input {width: 16em;}
    10571058#edit-slug-buttons a.save {
Note: See TracChangeset for help on using the changeset viewer.