Changeset 6794
- Timestamp:
- 02/11/2008 11:19:09 PM (17 years ago)
- Location:
- trunk/wp-admin
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/post.php
r6761 r6794 556 556 return ''; 557 557 } 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'); 559 559 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). '…' . 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>'; 563 565 $display_link = str_replace('%postname%', $post_name_html, $permalink); 564 566 return $display_link; -
trunk/wp-admin/js/slug.js
r6788 r6794 4 4 var revert_e = e.html(); 5 5 var real_slug = jQuery('#post_name'); 6 var revert_slug = real_slug.html(); 6 7 var b = jQuery('#edit-slug-buttons'); 7 8 var revert_b = b.html(); 8 var old_slug = e.children('span').html();9 var full = jQuery('#editable-post-name-full').html(); 9 10 10 11 b.html('<a href="" class="save">'+slugL10n.save+'</a> <a class="cancel" href="">'+slugL10n.cancel+'</a>'); … … 26 27 e.html(revert_e); 27 28 b.html(revert_b); 28 real_slug.attr('value', revert_ e);29 real_slug.attr('value', revert_slug); 29 30 return false; 30 31 }); 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++; 33 34 } 34 slug_value = (c > revert_e.length/4)? '' : revert_e;35 slug_value = (c > full.length/4)? '' : full; 35 36 e.html('<input type="text" id="new-post-slug" value="'+slug_value+'" />').children('input').keypress(function(e){ 36 37 var key = e.charCode ? e.charCode : e.keyCode ? e.keyCode : 0; -
trunk/wp-admin/wp-admin.css
r6781 r6794 1054 1054 #edit-slug-box strong {color: #777;} 1055 1055 #editable-post-name {background-color: #FFFBCC;} 1056 #editable-post-name-full {display: none;} 1056 1057 #editable-post-name input {width: 16em;} 1057 1058 #edit-slug-buttons a.save {
Note: See TracChangeset
for help on using the changeset viewer.