Ticket #28897: 28897.3.patch
File 28897.3.patch, 7.7 KB (added by , 11 years ago) |
---|
-
src/wp-includes/class-wp-editor.php
1375 1375 <?php wp_nonce_field( 'internal-linking', '_ajax_linking_nonce', false ); ?> 1376 1376 <div id="link-modal-title"> 1377 1377 <?php _e( 'Insert/edit link' ) ?> 1378 < div id="wp-link-close" tabindex="0"></div>1378 <button id="wp-link-close"><span class="screen-reader-text"><?php _e( 'Close' ); ?></span></button> 1379 1379 </div> 1380 1380 <div id="link-selector"> 1381 1381 <div id="link-options"> … … 1390 1390 <label><span> </span><input type="checkbox" id="link-target-checkbox" /> <?php _e( 'Open link in a new window/tab' ); ?></label> 1391 1391 </div> 1392 1392 </div> 1393 <p class="howto" id="wp-link-search-toggle"><?php _e( 'Or link to existing content' ); ?></p>1393 <p class="howto"><a href="#" id="wp-link-search-toggle"><?php _e( 'Or link to existing content' ); ?></a></p> 1394 1394 <div id="search-panel"> 1395 1395 <div class="link-search-wrapper"> 1396 1396 <label> … … 1399 1399 <span class="spinner"></span> 1400 1400 </label> 1401 1401 </div> 1402 <div id="search-results" class="query-results" >1402 <div id="search-results" class="query-results" tabindex="0"> 1403 1403 <ul></ul> 1404 1404 <div class="river-waiting"> 1405 1405 <span class="spinner"></span> 1406 1406 </div> 1407 1407 </div> 1408 <div id="most-recent-results" class="query-results"> 1409 <div class="query-notice"><em><?php _e( 'No search term specified. Showing recent items.' ); ?></em></div> 1408 <div id="most-recent-results" class="query-results" tabindex="0"> 1409 <div class="query-notice" id="query-notice-message"> 1410 <em class="query-notice-default"><?php _e( 'No search term specified. Showing recent items.' ); ?></em> 1411 <em class="query-notice-hint screen-reader-text"><?php _e( 'Search or use up and down arrow keys to select an item.' ); ?></em> 1412 </div> 1410 1413 <ul></ul> 1411 1414 <div class="river-waiting"> 1412 1415 <span class="spinner"></span> … … 1415 1418 </div> 1416 1419 </div> 1417 1420 <div class="submitbox"> 1421 <div id="wp-link-cancel"> 1422 <a class="submitdelete deletion" href="#"><?php _e( 'Cancel' ); ?></a> 1423 </div> 1418 1424 <div id="wp-link-update"> 1419 1425 <input type="submit" value="<?php esc_attr_e( 'Add Link' ); ?>" class="button button-primary" id="wp-link-submit" name="wp-link-submit"> 1420 1426 </div> 1421 <div id="wp-link-cancel">1422 <a class="submitdelete deletion" href="#"><?php _e( 'Cancel' ); ?></a>1423 </div>1424 1427 </div> 1425 1428 </form> 1426 1429 </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; 86 87 -webkit-box-shadow: inset 0 1px 2px rgba(0,0,0,0.07); 87 88 box-shadow: inset 0 1px 2px rgba(0,0,0,0.07); 88 -webkit-transition: .05s border-colorease-in-out;89 transition: .05s border-colorease-in-out;89 -webkit-transition: .05s all ease-in-out; 90 transition: .05s all ease-in-out; 90 91 } 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); … … 1061 1063 1062 1064 #wp-link-close { 1063 1065 color: #666; 1064 cursor: pointer;1065 1066 padding: 0; 1066 1067 position: absolute; 1067 1068 top: 0; … … 1069 1070 width: 36px; 1070 1071 height: 36px; 1071 1072 text-align: center; 1073 background: none; 1074 border: none; 1075 cursor: pointer; 1072 1076 } 1073 1077 1074 1078 #wp-link-close:before { … … 1087 1091 color: #2ea2cc; 1088 1092 } 1089 1093 1094 #wp-link-close:focus { 1095 outline: none; 1096 -webkit-box-shadow: 1097 0 0 0 1px #5b9dd9, 1098 0 0 2px 1px rgba(30, 140, 190, .8); 1099 box-shadow: 1100 0 0 0 1px #5b9dd9, 1101 0 0 2px 1px rgba(30, 140, 190, .8); 1102 } 1103 1090 1104 #link-selector { 1091 1105 padding: 0 16px 50px; 1092 1106 } … … 1135 1149 margin: 3px 0; 1136 1150 } 1137 1151 1152 #wp-link p.howto a { 1153 text-decoration: none; 1154 color: inherit; 1155 } 1156 1138 1157 #wp-link-search-toggle { 1139 1158 cursor: pointer; 1140 1159 } … … 1198 1217 top: 205px; 1199 1218 } 1200 1219 1201 #wp-link li, 1202 #wp-link .query-notice { 1220 #wp-link li { 1203 1221 clear: both; 1204 1222 margin-bottom: 0; 1205 1223 border-bottom: 1px solid #f1f1f1; 1206 1224 color: #333; 1207 padding: 4px 6px ;1225 padding: 4px 6px 4px 10px; 1208 1226 cursor: pointer; 1209 1227 position: relative; 1210 1228 } 1211 1229 1230 #wp-link .query-notice { 1231 padding: 0; 1232 border-bottom: 1px solid #dfdfdf; 1233 background-color: #f7fcfe; 1234 color: #000; 1235 } 1236 1237 #wp-link .query-notice .query-notice-default, 1238 #wp-link .query-notice .query-notice-hint { 1239 display: block; 1240 padding: 6px; 1241 border-left: 4px solid #2ea2cc; 1242 } 1243 1244 #wp-link .unselectable.no-matches-found { 1245 padding: 0; 1246 border-bottom: 1px solid #dfdfdf; 1247 background-color: #fef7f1; 1248 } 1249 1250 #wp-link .no-matches-found .item-title { 1251 display: block; 1252 padding: 6px; 1253 border-left: 4px solid #d54e21; 1254 } 1255 1256 #wp-link .query-results em { 1257 font-style: normal; 1258 } 1259 1212 1260 #wp-link li:hover { 1213 1261 background: #eaf2fa; 1214 1262 color: #151515; … … 1285 1333 1286 1334 #wp-link-cancel { 1287 1335 line-height: 25px; 1336 float: left; 1288 1337 } 1289 1338 1290 1339 #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 {