Ticket #18306: 18306.10.diff
File 18306.10.diff, 7.1 KB (added by , 12 years ago) |
---|
-
wp-includes/js/autosave.js
205 205 206 206 function autosave_update_slug(post_id) { 207 207 // 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() ) { 209 209 jQuery.post( ajaxurl, { 210 210 action: 'sample-permalink', 211 211 post_id: post_id, … … 215 215 function(data) { 216 216 if ( data !== '-1' ) { 217 217 jQuery('#edit-slug-box').html(data); 218 makeSlugeditClickable();219 218 } 220 219 } 221 220 ); -
wp-admin/includes/post.php
1073 1073 } 1074 1074 1075 1075 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>'; 1076 1078 $return = '<strong>' . __('Permalink:') . "</strong>\n" . '<span id="sample-permalink" tabindex="-1">' . $permalink . "</span>\n"; 1077 1079 if ( '' == get_option( 'permalink_structure' ) && current_user_can( 'manage_options' ) && !( 'page' == get_option('show_on_front') && $id == get_option('page_on_front') ) ) 1078 1080 $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";1081 1081 1082 1082 $return = apply_filters('get_sample_permalink_html', $return, $id, $new_title, $new_slug); 1083 1083 … … 1098 1098 } 1099 1099 } 1100 1100 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>'; 1102 1102 $display_link = str_replace(array('%pagename%','%postname%'), $post_name_html, $permalink); 1103 1103 $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>'; 1104 1106 $return = '<strong>' . __('Permalink:') . "</strong>\n"; 1105 1107 $return .= '<span id="sample-permalink" tabindex="-1">' . $display_link . "</span>\n"; 1106 1108 $return .= '‎'; // Fix bi-directional text display defect in RTL languages. 1107 1109 $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"; 1108 1110 $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";1111 1111 1112 1112 $return = apply_filters('get_sample_permalink_html', $return, $id, $new_title, $new_slug); 1113 1113 -
wp-admin/js/post.js
1 var tagBox, commentsBox, editPermalink, makeSlugeditClickable,WPSetThumbnailHTML, WPSetThumbnailID, WPRemoveThumbnail, wptitlehint;1 var tagBox, commentsBox, editPermalink, WPSetThumbnailHTML, WPSetThumbnailID, WPRemoveThumbnail, wptitlehint; 2 2 3 3 // return an array with any duplicate, whitespace or values removed 4 4 function array_unique_noempty(a) { … … 562 562 // permalink 563 563 if ( $('#edit-slug-box').length ) { 564 564 editPermalink = function(post_id) { 565 var i, c = 0, e = $('#editable-post-name'), re vert_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(); 566 566 567 567 $('#view-post-btn').hide(); 568 568 b.html('<a href="#" class="save button button-small">'+postL10n.ok+'</a> <a class="cancel" href="#">'+postL10n.cancel+'</a>'); … … 581 581 $('#edit-slug-box').html(data); 582 582 b.html(revert_b); 583 583 real_slug.val(new_slug); 584 makeSlugeditClickable();585 584 $('#view-post-btn').show(); 586 585 }); 587 586 return false; … … 589 588 590 589 $('.cancel', '#edit-slug-buttons').click(function() { 591 590 $('#view-post-btn').show(); 592 e.html(revert_e);591 s.html(revert_s); 593 592 b.html(revert_b); 594 593 real_slug.val(revert_slug); 595 594 return false; … … 601 600 } 602 601 603 602 slug_value = ( c > full.length / 4 ) ? '' : full; 603 e.parent('a').contents().unwrap(); 604 604 e.html('<input type="text" id="new-post-slug" value="'+slug_value+'" />').children('input').keypress(function(e){ 605 605 var key = e.keyCode || 0; 606 606 // on enter, just save the new slug, don't save the post … … 615 615 real_slug.val(this.value); 616 616 }).focus(); 617 617 } 618 619 makeSlugeditClickable = function() {620 $('#editable-post-name').click(function() {621 $('#edit-slug-buttons').children('.edit-slug').click();622 });623 }624 makeSlugeditClickable();625 618 } 626 619 627 620 // word count -
wp-admin/css/colors-fresh.css
713 713 #media-items a.delete, 714 714 #media-items a.delete-permanently, 715 715 .plugins a.delete, 716 .ui-tabs-nav a { 716 .ui-tabs-nav a, 717 #sample-permalink a:hover { 717 718 color: #21759b; 718 719 } 719 720 … … 757 758 background-color: #ddd; 758 759 } 759 760 760 #editable-post-name {761 background-color: #fffbcc;762 }763 764 761 #edit-slug-box strong, 765 762 .tablenav .displaying-num, 766 763 #submitted-on, -
wp-admin/css/wp-admin.css
2921 2921 font-size: 11px; 2922 2922 } 2923 2923 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 2924 2936 #editable-post-name-full { 2925 2937 display: none; 2926 2938 } 2927 2939 2928 2940 #editable-post-name input { 2929 2941 width: 16em; 2942 font-weight: normal; 2930 2943 } 2931 2944 2932 2945 .postarea h3 label { -
wp-admin/css/colors-classic.css
722 722 #media-items a.delete, 723 723 #media-items a.delete-permanently, 724 724 .plugins a.delete, 725 .ui-tabs-nav a { 725 .ui-tabs-nav a, 726 #sample-permalink a:hover { 726 727 color: #21759b; 727 728 } 728 729 … … 766 767 background-color: #ddd; 767 768 } 768 769 769 #editable-post-name {770 background-color: #fffbcc;771 }772 773 770 #edit-slug-box strong, 774 771 .tablenav .displaying-num, 775 772 #submitted-on,