Fix handling of no titles and long titles in internal linking. see #11240.

git-svn-id: https://develop.svn.wordpress.org/trunk@16750 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin 2010-12-06 16:28:06 +00:00
parent 6d54bcfe06
commit e6dbe89d7d
6 changed files with 8 additions and 7 deletions

View File

@ -54,7 +54,7 @@ function wp_link_query( $args = array() ) {
$results[] = array(
'ID' => $post->ID,
'title' => esc_html( strip_tags($post->post_title) ),
'title' => trim( esc_html( strip_tags( $post->post_title ) ) ),
'permalink' => get_permalink( $post->ID ),
'info' => $info,
);

View File

@ -1 +1 @@
#wp-link p.howto{margin:3px;}#link-options{padding:10px 0 14px;border-bottom:1px solid #dfdfdf;margin:0 6px 14px;}#wp-link label input[type="text"]{width:360px;margin-top:5px;}#wp-link label span{display:inline-block;width:80px;text-align:right;padding-right:5px;}#wp-link .link-search-wrapper{margin:5px 5px 9px;display:block;overflow:hidden;}#wp-link .link-search-wrapper span{float:left;margin-top:6px;}#wp-link .link-search-wrapper input[type="text"]{float:left;width:220px;}#wp-link .link-search-wrapper img.waiting{margin:8px 1px 0 4px;float:left;display:none;}#wp-link .link-target{width:auto;padding:3px 0 0;margin:0 0 0 87px;font-size:11px;}#wp-link .query-results{border:1px #dfdfdf solid;margin:0 5px 5px;background:#fff;height:185px;overflow:auto;position:relative;}#wp-link li,#wp-link .query-notice{margin-bottom:0;border-bottom:1px solid #f1f1f1;color:#333;padding:4px 6px;cursor:pointer;}#wp-link li:hover{background:#eaf2fa;color:#151515;}#wp-link li.unselectable{border-bottom:1px solid #dfdfdf;}#wp-link li.unselectable:hover{background:#fff;cursor:auto;color:#333;}#wp-link li.selected{background:#ddd;color:#333;}#wp-link li.selected .item-title{font-weight:bold;}#wp-link .item-info{text-transform:uppercase;color:#666;font-size:11px;float:right;}#search-results{display:none;}#wp-link .river-waiting{display:none;padding:10px 0;}#wp-link .river-waiting img.waiting{margin:0 auto;display:block;}#wp-link .submitbox{padding:5px 10px;font-size:11px;overflow:auto;height:29px;}#wp-link-cancel{line-height:25px;float:left;}#wp-link-update{line-height:23px;float:right;}
#wp-link p.howto{margin:3px;}#link-options{padding:10px 0 14px;border-bottom:1px solid #dfdfdf;margin:0 6px 14px;}#wp-link label input[type="text"]{width:360px;margin-top:5px;}#wp-link label span{display:inline-block;width:80px;text-align:right;padding-right:5px;}#wp-link .link-search-wrapper{margin:5px 5px 9px;display:block;overflow:hidden;}#wp-link .link-search-wrapper span{float:left;margin-top:6px;}#wp-link .link-search-wrapper input[type="text"]{float:left;width:220px;}#wp-link .link-search-wrapper img.waiting{margin:8px 1px 0 4px;float:left;display:none;}#wp-link .link-target{width:auto;padding:3px 0 0;margin:0 0 0 87px;font-size:11px;}#wp-link .query-results{border:1px #dfdfdf solid;margin:0 5px 5px;background:#fff;height:185px;overflow:auto;position:relative;}#wp-link li,#wp-link .query-notice{clear:both;margin-bottom:0;border-bottom:1px solid #f1f1f1;color:#333;padding:4px 6px;cursor:pointer;}#wp-link li:hover{background:#eaf2fa;color:#151515;}#wp-link li.unselectable{border-bottom:1px solid #dfdfdf;}#wp-link li.unselectable:hover{background:#fff;cursor:auto;color:#333;}#wp-link li.selected{background:#ddd;color:#333;}#wp-link li.selected .item-title{font-weight:bold;}#wp-link .item-info{text-transform:uppercase;color:#666;font-size:11px;float:right;}#search-results{display:none;}#wp-link .river-waiting{display:none;padding:10px 0;}#wp-link .river-waiting img.waiting{margin:0 auto;display:block;}#wp-link .submitbox{padding:5px 10px;font-size:11px;overflow:auto;height:29px;}#wp-link-cancel{line-height:25px;float:left;}#wp-link-update{line-height:23px;float:right;}

View File

@ -50,6 +50,7 @@
}
#wp-link li,
#wp-link .query-notice {
clear: both;
margin-bottom: 0;
border-bottom: 1px solid #f1f1f1;
color: #333;

View File

@ -355,7 +355,7 @@ var wpLink;
list += alt ? '<li class="alternate">' : '<li>';
list += '<input type="hidden" class="item-permalink" value="' + this['permalink'] + '" />';
list += '<span class="item-title">';
list += this['title'] ? this['title'] : '<em>'+ wpLinkL10n.untitled + '</em>';
list += this['title'] ? this['title'] : '<em>'+ wpLinkL10n.noTitle + '</em>';
list += '</span><span class="item-info">' + this['info'] + '</span></li>';
alt = ! alt;
});

File diff suppressed because one or more lines are too long

View File

@ -270,11 +270,11 @@ function wp_default_scripts( &$scripts ) {
'l10n_print_after' => 'try{convertEntities(adminBarL10n);}catch(e){};',
) );
$scripts->add( 'wplink', "/wp-includes/js/tinymce/plugins/wplink/js/wplink$suffix.js", array('jquery'), '20101123' );
$scripts->add( 'wplink', "/wp-includes/js/tinymce/plugins/wplink/js/wplink$suffix.js", array('jquery'), '20101206' );
$scripts->localize( 'wplink', 'wpLinkL10n', array(
'update' => __('Update'),
'save' => __('Save Link'),
'untitled' => __('Untitled'),
'noTitle' => __('(no title)'),
'noMatchesFound' => __('No matches found.'),
'l10n_print_after' => 'try{convertEntities(wpLinkL10n);}catch(e){};',
) );
@ -518,7 +518,7 @@ function wp_default_styles( &$styles ) {
$styles->add( 'nav-menu', "/wp-admin/css/nav-menu$suffix.css", array(), '20100907' );
$styles->add( 'admin-bar', "/wp-includes/css/admin-bar$suffix.css", array(), '20101201' );
$styles->add( 'wp-jquery-ui-dialog', "/wp-includes/css/jquery-ui-dialog$suffix.css", array(), '20101119' );
$styles->add( 'wplink', "/wp-includes/js/tinymce/plugins/wplink/css/wplink$suffix.css", array(), '20101123' );
$styles->add( 'wplink', "/wp-includes/js/tinymce/plugins/wplink/css/wplink$suffix.css", array(), '20101206' );
foreach ( $rtl_styles as $rtl_style ) {
$styles->add_data( $rtl_style, 'rtl', true );