Ticket #28897: 28897.patch
File 28897.patch, 6.5 KB (added by , 11 years ago) |
---|
-
src/wp-includes/class-wp-editor.php
1418 1418 <label><span> </span><input type="checkbox" id="link-target-checkbox" /> <?php _e( 'Open link in a new window/tab' ); ?></label> 1419 1419 </div> 1420 1420 </div> 1421 <p class="howto" id="wp-link-search-toggle"><?php _e( 'Or link to existing content' ); ?></p>1421 <p class="howto"><a href="#" id="wp-link-search-toggle"><?php _e( 'Or link to existing content' ); ?></a></p> 1422 1422 <div id="search-panel"> 1423 1423 <div class="link-search-wrapper"> 1424 1424 <label> … … 1427 1427 <span class="spinner"></span> 1428 1428 </label> 1429 1429 </div> 1430 <div id="search-results" class="query-results" >1430 <div id="search-results" class="query-results" tabindex="0"> 1431 1431 <ul></ul> 1432 1432 <div class="river-waiting"> 1433 1433 <span class="spinner"></span> 1434 1434 </div> 1435 1435 </div> 1436 <div id="most-recent-results" class="query-results"> 1437 <div class="query-notice"><em><?php _e( 'No search term specified. Showing recent items.' ); ?></em></div> 1436 <div id="most-recent-results" class="query-results" tabindex="0"> 1437 <div class="query-notice" id="query-notice-message"> 1438 <em class="query-notice-default"><?php _e( 'No search term specified. Showing recent items.' ); ?></em> 1439 <em class="query-notice-hint screen-reader-text"><?php _e( 'Search or use up and down arrow keys to select an item.' ); ?></em> 1440 </div> 1438 1441 <ul></ul> 1439 1442 <div class="river-waiting"> 1440 1443 <span class="spinner"></span> … … 1443 1446 </div> 1444 1447 </div> 1445 1448 <div class="submitbox"> 1449 <div id="wp-link-cancel"> 1450 <a class="submitdelete deletion" href="#"><?php _e( 'Cancel' ); ?></a> 1451 </div> 1446 1452 <div id="wp-link-update"> 1447 1453 <input type="submit" value="<?php esc_attr_e( 'Add Link' ); ?>" class="button button-primary" id="wp-link-submit" name="wp-link-submit"> 1448 1454 </div> 1449 <div id="wp-link-cancel">1450 <a class="submitdelete deletion" href="#"><?php _e( 'Cancel' ); ?></a>1451 </div>1452 1455 </div> 1453 1456 </form> 1454 1457 </div> -
src/wp-includes/css/editor.css
79 79 } 80 80 81 81 .mce-textbox, 82 .mce-checkbox i.mce-i-checkbox { 82 .mce-checkbox i.mce-i-checkbox, 83 #wp-link .query-results { 83 84 border: 1px solid #ddd; 84 85 -webkit-border-radius: 0; 85 86 border-radius: 0; … … 91 92 92 93 .mce-textbox:focus, 93 94 .mce-textbox.mce-focus, 94 .mce-checkbox:focus i.mce-i-checkbox { 95 .mce-checkbox:focus i.mce-i-checkbox, 96 #wp-link .query-results:focus { 95 97 border-color: #5b9dd9; 96 98 -webkit-box-shadow: 0 0 2px rgba(30,140,190,0.8); 97 99 box-shadow: 0 0 2px rgba(30,140,190,0.8); … … 1134 1136 margin: 3px 0; 1135 1137 } 1136 1138 1139 #wp-link p.howto a { 1140 text-decoration: none; 1141 color: inherit; 1142 } 1143 1137 1144 #wp-link-search-toggle { 1138 1145 cursor: pointer; 1139 1146 } … … 1197 1204 top: 205px; 1198 1205 } 1199 1206 1200 #wp-link li, 1201 #wp-link .query-notice { 1207 #wp-link li { 1202 1208 clear: both; 1203 1209 margin-bottom: 0; 1204 1210 border-bottom: 1px solid #f1f1f1; 1205 1211 color: #333; 1206 padding: 4px 6px ;1212 padding: 4px 6px 4px 10px; 1207 1213 cursor: pointer; 1208 1214 position: relative; 1209 1215 } 1210 1216 1217 #wp-link .query-notice { 1218 padding: 0; 1219 border-bottom: 1px solid #dfdfdf; 1220 background-color: #f7fcfe; 1221 color: #000; 1222 } 1223 1224 #wp-link .query-notice .query-notice-default, 1225 #wp-link .query-notice .query-notice-hint { 1226 display: block; 1227 padding: 6px; 1228 border-left: 4px solid #2ea2cc; 1229 } 1230 1231 #wp-link .unselectable.no-matches-found { 1232 padding: 0; 1233 border-bottom: 1px solid #dfdfdf; 1234 background-color: #fef7f1; 1235 } 1236 1237 #wp-link .no-matches-found .item-title { 1238 display: block; 1239 padding: 6px; 1240 border-left: 4px solid #d54e21; 1241 } 1242 1243 #wp-link .query-results em { 1244 font-style: normal; 1245 } 1246 1211 1247 #wp-link li:hover { 1212 1248 background: #eaf2fa; 1213 1249 color: #151515; … … 1284 1320 1285 1321 #wp-link-cancel { 1286 1322 line-height: 25px; 1323 float: left; 1287 1324 } 1288 1325 1289 1326 #wp-link-update { -
src/wp-includes/js/wplink.js
31 31 rivers.recent = new River( $( '#most-recent-results' ) ); 32 32 rivers.elements = inputs.dialog.find( '.query-results' ); 33 33 34 // Get search notice text 35 inputs.queryNotice = $( '#query-notice-message' ); 36 inputs.queryNoticeTextDefault = inputs.queryNotice.find( '.query-notice-default' ); 37 inputs.queryNoticeTextHint = inputs.queryNotice.find( '.query-notice-hint' ); 38 34 39 // Bind event handlers 35 40 inputs.dialog.keydown( wpLink.keydown ); 36 41 inputs.dialog.keyup( wpLink.keyup ); … … 43 48 wpLink.close(); 44 49 }); 45 50 46 $( '#wp-link-search-toggle' ). click(wpLink.toggleInternalLinking );51 $( '#wp-link-search-toggle' ).on( 'click', wpLink.toggleInternalLinking ); 47 52 48 53 rivers.elements.on( 'river-select', wpLink.updateFields ); 49 54 55 // Display 'hint' message when search field or 'query-results' box are focused 56 inputs.search.add( rivers.elements ).on( 'focus.wplink', function() { 57 inputs.queryNoticeTextDefault.hide(); 58 inputs.queryNoticeTextHint.removeClass( 'screen-reader-text' ).show(); 59 } ).on( 'blur.wplink', function() { 60 inputs.queryNoticeTextDefault.show(); 61 inputs.queryNoticeTextHint.addClass( 'screen-reader-text' ).hide(); 62 } ); 63 50 64 inputs.search.keyup( function() { 51 65 var self = this; 52 66 … … 335 349 } else if ( key.TAB === event.keyCode ) { 336 350 id = event.target.id; 337 351 352 // wp-link-submit must always be the last focusable element in the dialog. 353 // following focusable elements will be skipped on keyboard navigation. 338 354 if ( id === 'wp-link-submit' && ! event.shiftKey ) { 339 355 inputs.close.focus(); 340 356 event.preventDefault(); … … 387 403 }; 388 404 }, 389 405 390 toggleInternalLinking: function( ) {406 toggleInternalLinking: function( event ) { 391 407 var visible = inputs.wrap.hasClass( 'search-panel-visible' ); 392 408 393 409 inputs.wrap.toggleClass( 'search-panel-visible', ! visible ); 394 410 setUserSetting( 'wplink', visible ? '0' : '1' ); 395 411 inputs[ ! visible ? 'search' : 'url' ].focus(); 412 event.preventDefault(); 396 413 } 397 414 }; 398 415 … … 502 519 503 520 if ( ! results ) { 504 521 if ( firstPage ) { 505 list += '<li class="unselectable "><span class="item-title"><em>' +522 list += '<li class="unselectable no-matches-found"><span class="item-title"><em>' + 506 523 wpLinkL10n.noMatchesFound + '</em></span></li>'; 507 524 } 508 525 } else {