Ticket #26952: 26952.9.patch
File 26952.9.patch, 39.4 KB (added by , 11 years ago) |
---|
-
src/wp-includes/class-wp-editor.php
241 241 'wpeditimage', 242 242 'wpgallery', 243 243 'wplink', 244 'wpdialogs',245 244 'wpview', 246 245 ) ) ); 247 246 … … 492 491 493 492 if ( in_array('wplink', self::$plugins, true) || in_array('link', self::$qt_buttons, true) ) { 494 493 wp_enqueue_script('wplink'); 495 wp_enqueue_script('wpdialogs');496 wp_enqueue_style('wp-jquery-ui-dialog');497 494 } 498 495 499 496 if ( in_array('wpfullscreen', self::$plugins, true) || in_array('fullscreen', self::$qt_buttons, true) ) … … 1041 1038 * @since 3.1.0 1042 1039 */ 1043 1040 public static function wp_link_dialog() { 1044 ?> 1045 <div style="display:none;"> 1046 <form id="wp-link" tabindex="-1"> 1047 <?php wp_nonce_field( 'internal-linking', '_ajax_linking_nonce', false ); ?> 1048 <div id="link-selector"> 1049 <div id="link-options"> 1050 <p class="howto"><?php _e( 'Enter the destination URL' ); ?></p> 1051 <div> 1052 <label><span><?php _e( 'URL' ); ?></span><input id="url-field" type="text" name="href" /></label> 1053 </div> 1054 <div> 1055 <label><span><?php _e( 'Title' ); ?></span><input id="link-title-field" type="text" name="linktitle" /></label> 1056 </div> 1057 <div class="link-target"> 1058 <label><input type="checkbox" id="link-target-checkbox" /> <?php _e( 'Open link in a new window/tab' ); ?></label> 1059 </div> 1060 </div> 1061 <?php $show_internal = '1' == get_user_setting( 'wplink', '0' ); ?> 1062 <p class="howto toggle-arrow <?php if ( $show_internal ) echo 'toggle-arrow-active'; ?>" id="internal-toggle"><?php _e( 'Or link to existing content' ); ?></p> 1063 <div id="search-panel"<?php if ( ! $show_internal ) echo ' style="display:none"'; ?>> 1064 <div class="link-search-wrapper"> 1065 <label> 1066 <span class="search-label"><?php _e( 'Search' ); ?></span> 1067 <input type="search" id="search-field" class="link-search-field" autocomplete="off" /> 1068 <span class="spinner"></span> 1069 </label> 1070 </div> 1071 <div id="search-results" class="query-results"> 1072 <ul></ul> 1073 <div class="river-waiting"> 1074 <span class="spinner"></span> 1041 $search_panel_visible = '1' == get_user_setting( 'wplink', '0' ) ? ' class="search-panel-visible"' : ''; 1042 1043 ?> 1044 <div id="wp-link-backdrop"></div> 1045 <div id="wp-link-wrap"<?php echo $search_panel_visible; ?>> 1046 <form id="wp-link" tabindex="-1"> 1047 <?php wp_nonce_field( 'internal-linking', '_ajax_linking_nonce', false ); ?> 1048 <div id="link-modal-title"> 1049 <?php _e( 'Insert/edit link' ) ?> 1050 <div id="wp-link-close" tabindex="0"></div> 1051 </div> 1052 <div id="link-selector"> 1053 <div id="link-options"> 1054 <p class="howto"><?php _e( 'Enter the destination URL' ); ?></p> 1055 <div> 1056 <label><span><?php _e( 'URL' ); ?></span><input id="url-field" type="text" name="href" /></label> 1057 </div> 1058 <div> 1059 <label><span><?php _e( 'Title' ); ?></span><input id="link-title-field" type="text" name="linktitle" /></label> 1060 </div> 1061 <div class="link-target"> 1062 <label><input type="checkbox" id="link-target-checkbox" /> <?php _e( 'Open link in a new window/tab' ); ?></label> 1075 1063 </div> 1076 1064 </div> 1077 <div id="most-recent-results" class="query-results"> 1078 <div class="query-notice"><em><?php _e( 'No search term specified. Showing recent items.' ); ?></em></div> 1079 <ul></ul> 1080 <div class="river-waiting"> 1081 <span class="spinner"></span> 1065 <p class="howto" id="wp-link-search-toggle"><?php _e( 'Or link to existing content' ); ?></p> 1066 <div id="search-panel"> 1067 <div class="link-search-wrapper"> 1068 <label> 1069 <span class="search-label"><?php _e( 'Search' ); ?></span> 1070 <input type="search" id="search-field" class="link-search-field" autocomplete="off" /> 1071 <span class="spinner"></span> 1072 </label> 1073 </div> 1074 <div id="search-results" class="query-results"> 1075 <ul></ul> 1076 <div class="river-waiting"> 1077 <span class="spinner"></span> 1078 </div> 1079 </div> 1080 <div id="most-recent-results" class="query-results"> 1081 <div class="query-notice"><em><?php _e( 'No search term specified. Showing recent items.' ); ?></em></div> 1082 <ul></ul> 1083 <div class="river-waiting"> 1084 <span class="spinner"></span> 1085 </div> 1082 1086 </div> 1083 1087 </div> 1084 1088 </div> 1085 </div> 1086 <div class="submitbox"> 1087 <div id="wp-link-update"> 1088 <input type="submit" value="<?php esc_attr_e( 'Add Link' ); ?>" class="button-primary" id="wp-link-submit" name="wp-link-submit"> 1089 <div class="submitbox"> 1090 <div id="wp-link-update"> 1091 <input type="submit" value="<?php esc_attr_e( 'Add Link' ); ?>" class="button-primary" id="wp-link-submit" name="wp-link-submit"> 1092 </div> 1093 <div id="wp-link-cancel"> 1094 <a class="submitdelete deletion" href="#"><?php _e( 'Cancel' ); ?></a> 1095 </div> 1089 1096 </div> 1090 <div id="wp-link-cancel"> 1091 <a class="submitdelete deletion" href="#"><?php _e( 'Cancel' ); ?></a> 1097 </form> 1092 1098 </div> 1093 </div> 1094 </form> 1095 </div> 1096 <?php 1099 <?php 1097 1100 } 1098 1101 } -
src/wp-includes/css/buttons.css
1 1 /* ---------------------------------------------------------------------------- 2 2 3 NOTE: If you edit this file, you should make sure that the CSS rules for 4 buttons in the following files are updated. 5 6 * jquery-ui-dialog.css 7 * editor.css 3 8 4 9 WordPress-style Buttons 5 10 ======================= -
src/wp-includes/css/editor.css
313 313 text-align: center; 314 314 color: #fff; 315 315 text-shadow: none; 316 padding: 0; 317 line-height: 26px; 316 318 } 317 319 318 320 .mce-window .mce-btn { … … 335 337 background-image: none; 336 338 } 337 339 340 /* Remove the dotted border on :focus and the extra padding in Firefox */ 341 .mce-window .mce-btn::-moz-focus-inner { 342 border-width: 1px 0; 343 border-style: solid none; 344 border-color: transparent; 345 padding: 0; 346 } 347 338 348 .mce-window .mce-btn:hover { 339 349 background: #fafafa; 340 350 border-color: #999; … … 366 376 .mce-window .mce-btn.mce-primary { 367 377 background: #2ea2cc; 368 378 border-color: #0074a2; 369 -webkit-box-shadow: inset 0 1px 0 rgba(120,200,230,0.5), 0 1px 0 rgba(0,0,0,.15); 370 box-shadow: inset 0 1px 0 rgba(120,200,230,0.5), 0 1px 0 rgba(0,0,0,.15); 371 color: #fff; 379 -webkit-box-shadow: inset 0 1px 0 rgba(120,200,230,0.5), 0 1px 0 rgba(0,0,0,.15); 380 box-shadow: inset 0 1px 0 rgba(120,200,230,0.5), 0 1px 0 rgba(0,0,0,.15); 381 color: #fff; 382 text-decoration: none; 372 383 } 373 384 374 385 .mce-window .mce-btn.mce-primary:hover { 375 386 background: #1e8cbe; 376 387 border-color: #0074a2; 377 378 388 -webkit-box-shadow: inset 0 1px 0 rgba(120,200,230,0.6); 389 box-shadow: inset 0 1px 0 rgba(120,200,230,0.6); 379 390 color: #fff; 380 391 } 381 392 … … 389 400 background: #1b7aa6; 390 401 border-color: #005684; 391 402 color: rgba(255,255,255,0.95); 392 393 403 -webkit-box-shadow: inset 0 1px 0 rgba(0,0,0,0.1); 404 box-shadow: inset 0 1px 0 rgba(0,0,0,0.1); 394 405 } 395 406 396 407 .mce-window .mce-btn.mce-primary.mce-disabled { … … 400 411 text-shadow: 0 -1px 0 rgba(0,0,0,0.1); 401 412 } 402 413 414 @media screen and ( max-width: 782px ) { 415 .mce-window .mce-btn { 416 padding: 10px 14px; 417 line-height: 1; 418 font-size: 14px; 419 vertical-align: middle; 420 height: auto; 421 margin-bottom: 4px; 422 } 423 } 424 403 425 /* Charmap modal */ 404 426 .mce-charmap { 405 427 margin: 3px; … … 864 886 wp-link 865 887 ------------------------------------------------------------------------------*/ 866 888 889 #wp-link-wrap { 890 display: none; 891 background-color: #fff; 892 width: 600px; 893 overflow: hidden; 894 margin-left: -300px; 895 position: fixed; 896 top: 30px; 897 left: 50%; 898 z-index: 100105; 899 } 900 901 #wp-link-backdrop { 902 display: none; 903 position: fixed; 904 top: 0; 905 left: 0; 906 right: 0; 907 bottom: 0; 908 min-height: 360px; 909 background: #000; 910 opacity: 0.7; 911 z-index: 100100; 912 } 913 867 914 #wp-link { 868 background-color: #F5F5F5; 869 line-height: 1.4em; 870 font-size: 12px; 915 position: relative; 916 height: 100%; 917 } 918 919 #wp-link-wrap.search-panel-visible { 920 bottom: 30px; 921 } 922 923 #link-modal-title { 924 background: #fcfcfc; 925 border-bottom: 1px solid #dfdfdf; 926 height: 42px; 927 font-size: 22px; 928 font-weight: 600; 929 line-height: 41px; 930 padding: 0 42px 0 16px; 931 top: 0; 932 right: 0; 933 left: 0; 934 } 935 936 #wp-link-close { 937 color: #666; 938 cursor: pointer; 939 padding: 0; 940 position: absolute; 941 top: 0; 942 right: 0; 943 width: 42px; 944 height: 42px; 945 text-align: center; 946 } 947 948 #wp-link-close:before { 949 font: normal 20px/42px 'dashicons'; 950 vertical-align: top; 951 speak: none; 952 -webkit-font-smoothing: antialiased; 953 -moz-osx-font-smoothing: grayscale; 954 width: 42px; 955 height: 42px; 956 content: '\f158'; 957 } 958 959 #wp-link-close:hover { 960 color: #2ea2cc; 961 } 962 963 #link-selector { 964 padding: 0 16px 52px; 965 } 966 967 #wp-link-wrap.search-panel-visible #link-selector { 968 padding: 0 16px; 969 position: absolute; 970 top: 42px; 971 left: 0; 972 right: 0; 973 bottom: 44px; 871 974 } 872 975 873 976 #wp-link ol, … … 877 980 padding: 0; 878 981 } 879 982 983 #wp-link-search-toggle::after { 984 font: normal 20px/1 'dashicons'; 985 vertical-align: top; 986 speak: none; 987 -webkit-font-smoothing: antialiased; 988 -moz-osx-font-smoothing: grayscale; 989 content: '\f140'; 990 } 991 992 .search-panel-visible #wp-link-search-toggle::after { 993 content: '\f142'; 994 } 995 880 996 #wp-link input[type="text"] { 881 997 -webkit-box-sizing: border-box; 882 998 -moz-box-sizing: border-box; 883 999 box-sizing: border-box; 884 1000 } 885 1001 886 #wp-link input[type="text"],887 #wp-link textarea {888 border-width: 1px;889 border-style: solid;890 -webkit-border-radius: 4px;891 border-radius: 4px;892 font-size: 12px;893 margin: 1px;894 padding: 3px;895 }896 897 1002 #wp-link #link-options { 898 1003 padding: 10px 0 14px; 899 border-bottom: 1px solid #dfdfdf;900 margin: 0 6px 14px;901 1004 } 902 1005 903 1006 #wp-link p.howto { 904 margin: 3px ;1007 margin: 3px 0; 905 1008 } 906 1009 907 #wp-link #internal-toggle { 908 display: inline-block; 1010 #wp-link-search-toggle { 909 1011 cursor: pointer; 910 padding-left: 18px;911 }912 913 #wp-link .toggle-arrow {914 background: transparent url(../images/toggle-arrow.png) top left no-repeat;915 height: 23px;916 line-height: 23px;917 }918 919 #wp-link .toggle-arrow-active {920 background-position: center left;921 1012 } 922 1013 923 1014 #wp-link label input[type="text"] { 924 width: 360px;1015 width: 400px; 925 1016 margin-top: 5px; 1017 max-width: 70%; 926 1018 } 927 1019 928 1020 #wp-link #link-options label span, … … 931 1023 width: 80px; 932 1024 text-align: right; 933 1025 padding-right: 5px; 1026 max-width: 24%; 934 1027 } 935 1028 936 1029 #wp-link .link-search-field { 937 1030 float: left; 938 width: 220px; 1031 width: 250px; 1032 max-width: 70%; 939 1033 } 940 1034 941 1035 #wp-link .link-search-wrapper { 942 margin: 5px 6px9px;1036 margin: 5px 0 9px; 943 1037 display: block; 944 1038 overflow: hidden; 945 1039 } … … 958 1052 width: auto; 959 1053 padding: 3px 0 0; 960 1054 margin: 0 0 0 87px; 961 font-size: 11px;962 1055 } 963 1056 964 1057 #wp-link .query-results { 965 1058 border: 1px #dfdfdf solid; 966 margin: 0 5px 5px;1059 margin: 0; 967 1060 background: #fff; 968 height: 185px;969 1061 overflow: auto; 970 position: relative; 1062 position: absolute; 1063 left: 16px; 1064 right: 16px; 1065 bottom: 16px; 1066 top: 205px; 971 1067 } 972 1068 973 1069 #wp-link li, … … 1005 1101 font-weight: bold; 1006 1102 } 1007 1103 1104 #wp-link li:last-child { 1105 border: none; 1106 } 1107 1008 1108 #wp-link .item-title { 1009 1109 display: inline-block; 1010 1110 width: 80%; … … 1020 1120 bottom: 0; 1021 1121 } 1022 1122 1023 #wp-link #search-results { 1123 #wp-link #search-results, 1124 #wp-link #search-panel { 1024 1125 display: none; 1025 1126 } 1026 1127 1027 #wp-link #search-panel { 1028 float: left; 1029 width: 100%; 1128 #wp-link-wrap.search-panel-visible #search-panel { 1129 display: block; 1030 1130 } 1031 1131 1032 1132 #wp-link .river-waiting { … … 1040 1140 } 1041 1141 1042 1142 #wp-link .submitbox { 1043 padding: 5px 10px; 1044 font-size: 11px; 1045 overflow: auto; 1046 height: 29px; 1143 padding: 8px 16px; 1144 background: #fcfcfc; 1145 border-top: 1px solid #dfdfdf; 1146 position: absolute; 1147 bottom: 0; 1148 left: 0; 1149 right: 0; 1047 1150 } 1048 1151 1049 1152 #wp-link-cancel { … … 1056 1159 float: right; 1057 1160 } 1058 1161 1059 /*! 1060 * jQuery UI CSS Framework 1.10.1 1061 * http://jqueryui.com 1062 * 1063 * Copyright 2013 jQuery Foundation and other contributors 1064 * Released under the MIT license. 1065 * http://jquery.org/license 1066 * 1067 * http://docs.jquery.com/UI/Theming/API 1068 */ 1069 1070 /* Layout helpers 1071 ----------------------------------*/ 1072 .ui-helper-hidden { 1073 display: none; 1074 } 1075 .ui-helper-hidden-accessible { 1076 border: 0; 1077 clip: rect(0 0 0 0); 1078 height: 1px; 1079 margin: -1px; 1080 overflow: hidden; 1081 padding: 0; 1082 position: absolute; 1083 width: 1px; 1084 } 1085 .ui-helper-reset { 1086 margin: 0; 1087 padding: 0; 1088 border: 0; 1089 outline: 0; 1090 line-height: 1.3; 1091 text-decoration: none; 1092 font-size: 100%; 1093 list-style: none; 1094 } 1095 .ui-helper-clearfix:before, 1096 .ui-helper-clearfix:after { 1097 content: ""; 1098 display: table; 1099 border-collapse: collapse; 1100 } 1101 .ui-helper-clearfix:after { 1102 clear: both; 1103 } 1104 .ui-helper-clearfix { 1105 min-height: 0; /* support: IE7 */ 1106 } 1107 .ui-helper-zfix { 1108 width: 100%; 1109 height: 100%; 1110 top: 0; 1111 left: 0; 1112 position: absolute; 1113 opacity: 0; 1114 filter:Alpha(Opacity=0); 1115 } 1116 1117 .ui-front { 1118 z-index: 100; 1119 } 1120 1121 1122 /* Interaction Cues 1123 ----------------------------------*/ 1124 .ui-state-disabled { 1125 cursor: default !important; 1126 } 1127 1128 1129 /* Icons 1130 ----------------------------------*/ 1131 1132 /* states and images */ 1133 .ui-icon { 1134 display: block; 1135 text-indent: -99999px; 1136 overflow: hidden; 1137 background-repeat: no-repeat; 1138 } 1139 1140 1141 /* Misc visuals 1142 ----------------------------------*/ 1143 1144 /* Overlays */ 1145 .ui-widget-overlay { 1146 position: fixed; 1147 top: 0; 1148 left: 0; 1149 width: 100%; 1150 height: 100%; 1151 } 1152 1153 1154 /*! 1155 * jQuery UI Resizable 1.10.1 1156 * http://jqueryui.com 1157 * 1158 * Copyright 2013 jQuery Foundation and other contributors 1159 * Released under the MIT license. 1160 * http://jquery.org/license 1161 * 1162 * http://docs.jquery.com/UI/Resizable#theming 1163 */ 1164 .ui-resizable { 1165 position: relative; 1166 } 1167 .ui-resizable-handle { 1168 position: absolute; 1169 font-size: 0.1px; 1170 display: block; 1171 } 1172 .ui-resizable-disabled .ui-resizable-handle, 1173 .ui-resizable-autohide .ui-resizable-handle { 1174 display: none; 1175 } 1176 .ui-resizable-n { 1177 cursor: n-resize; 1178 height: 7px; 1179 width: 100%; 1180 top: -5px; 1181 left: 0; 1182 } 1183 .ui-resizable-s { 1184 cursor: s-resize; 1185 height: 7px; 1186 width: 100%; 1187 bottom: -5px; 1188 left: 0; 1189 } 1190 .ui-resizable-e { 1191 cursor: e-resize; 1192 width: 7px; 1193 right: -5px; 1194 top: 0; 1195 height: 100%; 1196 } 1197 .ui-resizable-w { 1198 cursor: w-resize; 1199 width: 7px; 1200 left: -5px; 1201 top: 0; 1202 height: 100%; 1203 } 1204 .ui-resizable-se { 1205 cursor: se-resize; 1206 width: 12px; 1207 height: 12px; 1208 right: 1px; 1209 bottom: 1px; 1210 } 1211 .ui-resizable-sw { 1212 cursor: sw-resize; 1213 width: 9px; 1214 height: 9px; 1215 left: -5px; 1216 bottom: -5px; 1217 } 1218 .ui-resizable-nw { 1219 cursor: nw-resize; 1220 width: 9px; 1221 height: 9px; 1222 left: -5px; 1223 top: -5px; 1224 } 1225 .ui-resizable-ne { 1226 cursor: ne-resize; 1227 width: 9px; 1228 height: 9px; 1229 right: -5px; 1230 top: -5px; 1231 } 1232 1233 /*! 1234 * jQuery UI Dialog 1.10.1 1235 * http://jqueryui.com 1236 * 1237 * Copyright 2013 jQuery Foundation and other contributors 1238 * Released under the MIT license. 1239 * http://jquery.org/license 1240 * 1241 * http://docs.jquery.com/UI/Dialog#theming 1242 */ 1243 .ui-dialog { 1244 position: absolute; 1245 top: 0; 1246 /* @noflip */ 1247 left: 0; 1248 padding: .2em; 1249 outline: 0; 1250 } 1251 .ui-dialog .ui-dialog-titlebar { 1252 padding: .4em 1em; 1253 position: relative; 1254 } 1255 .ui-dialog .ui-dialog-title { 1256 float: left; 1257 margin: .1em 0; 1258 white-space: nowrap; 1259 width: 90%; 1260 overflow: hidden; 1261 text-overflow: ellipsis; 1262 } 1263 .ui-dialog .ui-dialog-titlebar-close { 1264 position: absolute; 1265 right: .3em; 1266 top: 50%; 1267 width: 21px; 1268 margin: -10px 0 0 0; 1269 padding: 1px; 1270 height: 20px; 1271 } 1272 .ui-dialog .ui-dialog-content { 1273 position: relative; 1274 border: 0; 1275 padding: .5em 1em; 1276 background: none; 1277 overflow: auto; 1278 } 1279 .ui-dialog .ui-dialog-buttonpane { 1280 text-align: left; 1281 border-width: 1px 0 0 0; 1282 background-image: none; 1283 margin-top: .5em; 1284 padding: .3em 1em .5em .4em; 1285 } 1286 .ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { 1162 #wp-link-submit { 1287 1163 float: right; 1288 } 1289 .ui-dialog .ui-dialog-buttonpane button { 1290 margin: .5em .4em .5em 0; 1291 cursor: pointer; 1292 } 1293 .ui-dialog .ui-resizable-se { 1294 width: 12px; 1295 height: 12px; 1296 right: -5px; 1297 bottom: -5px; 1298 background-position: 16px 16px; 1299 } 1300 .ui-draggable .ui-dialog-titlebar { 1301 cursor: move; 1302 } 1303 1304 /* WP jQuery Dialog Theme */ 1305 .wp-dialog { 1306 padding: 0; 1307 z-index: 300002; 1308 border: 0; 1309 -webkit-box-shadow: 0 5px 15px rgba(0,0,0,0.7); 1310 box-shadow: 0 5px 15px rgba(0,0,0,0.7); 1311 background-color: #f5f5f5; 1312 } 1313 1314 .wp-dialog .ui-dialog-title { 1315 display: block; 1316 text-align: center; 1317 padding: 0; 1318 } 1319 1320 .wp-dialog .ui-dialog-titlebar { 1321 padding: 0 1em; 1322 background-color: #444; 1323 font-size: 13px; 1324 line-height: 24px; 1325 color: #fff; 1164 margin-bottom: 0; 1326 1165 } 1327 1166 1328 .wp-dialog .ui-dialog-content { 1329 padding: 0; 1330 } 1167 @media screen and ( max-width: 782px ), ( max-height: 440px ) { 1331 1168 1332 .wp-dialog .ui-dialog-titlebar-close { 1333 cursor: pointer; 1334 -webkit-appearance: none; 1335 border: 0; 1336 width: 30px; 1337 height: 20px; 1338 top: 13px; 1339 right: 6px; 1340 background: none; 1341 } 1169 #wp-link-wrap, 1170 #wp-link-wrap.search-panel-visible { 1171 width: auto; 1172 margin: 0; 1173 top: 10px; 1174 left: 10px; 1175 right: 10px; 1176 bottom: 10px; 1177 max-width: 600px; 1178 margin: auto; 1179 } 1342 1180 1343 .wp-dialog .ui-dialog-titlebar-close:before { 1344 content: '\f158'; 1345 font: normal 20px/1 'dashicons'; 1346 speak: none; 1347 -webkit-font-smoothing: antialiased; 1348 -moz-osx-font-smoothing: grayscale; 1349 color: #999; 1350 padding-left: 12px; 1351 } 1181 #link-selector { 1182 overflow: auto; 1183 height: calc(100% - 88px); 1184 padding-bottom: 0; 1185 } 1352 1186 1353 .wp-dialog .ui-dialog-titlebar-close:hover:before{1354 color: #2ea2cc;1355 }1187 #wp-link #search-panel { 1188 display: block; 1189 } 1356 1190 1357 .wp-dialog .ui-dialog-titlebar-close .ui-button-text{1358 display: none;1359 }1191 #wp-link-search-toggle { 1192 display: none; 1193 } 1360 1194 1361 .wp-dialog .ui-dialog-titlebar-close:hover, 1362 .wp-dialog .ui-dialog-titlebar-close:focus { 1363 background-position: -87px -32px; 1364 } 1195 #search-panel .query-results { 1196 position: static; 1197 } 1365 1198 1366 .ui-widget-overlay {1367 z-index: 300001;1368 background-color: #000;1369 opacity: 0.6;1370 filter: alpha(opacity=60);1371 1199 } 1372 1200 1373 /* TinyMCEmodal */1374 /* TODO: restyle the TinyMCE 4.0 modals1201 /* Old TinyMCE 3.x modal */ 1202 /* 1375 1203 .clearlooks2 .mceTop { 1376 1204 border-bottom: 1px solid #ccc; 1377 1205 } … … 1807 1635 font-family: Arial, sans-serif; 1808 1636 } 1809 1637 1810 1811 1638 /* HiDPI */ 1812 1639 @media print, 1813 1640 (-o-min-device-pixel-ratio: 5/4), … … 1817 1644 #wp-fullscreen-buttons #wp_fs_image span.mce_image { 1818 1645 background: none; 1819 1646 } 1820 1821 #wp-link .toggle-arrow {1822 background: transparent url(../images/toggle-arrow-2x.png) top left no-repeat;1823 -webkit-background-size: 19px 69px;1824 background-size: 19px 69px;1825 }1826 1647 } 1827 1648 1828 1649 /* TODO: DFW responsive */ 1829 1830 -
src/wp-includes/css/jquery-ui-dialog.css
56 56 filter:Alpha(Opacity=0); 57 57 } 58 58 59 .ui-front {60 z-index: 100;61 }62 63 64 59 /* Interaction Cues 65 60 ----------------------------------*/ 66 61 .ui-state-disabled { 67 62 cursor: default !important; 68 63 } 69 64 70 71 65 /* Icons 72 66 ----------------------------------*/ 73 67 … … 79 73 background-repeat: no-repeat; 80 74 } 81 75 82 83 /* Misc visuals84 ----------------------------------*/85 86 /* Overlays */87 .ui-widget-overlay {88 position: fixed;89 top: 0;90 left: 0;91 width: 100%;92 height: 100%;93 }94 95 96 76 /*! 97 77 * jQuery UI Resizable 1.10.1 98 78 * http://jqueryui.com … … 148 128 /* @noflip */ 149 129 .ui-resizable-se { 150 130 cursor: se-resize; 151 width: 12px;152 height: 12px;153 right: 1px;154 bottom: 1px;131 width: 9px; 132 height: 9px; 133 right: -5px; 134 bottom: -5px; 155 135 } 156 136 /* @noflip */ 157 137 .ui-resizable-sw { … … 178 158 top: -5px; 179 159 } 180 160 181 /*! 182 * jQuery UI Dialog 1.10.1 183 * http://jqueryui.com 184 * 185 * Copyright 2013 jQuery Foundation and other contributors 186 * Released under the MIT license. 187 * http://jquery.org/license 188 * 189 * http://docs.jquery.com/UI/Dialog#theming 190 */ 191 .ui-dialog { 192 position: absolute; 193 top: 0; 194 /* @noflip */ 195 left: 0; 196 padding: .2em; 197 outline: 0; 198 } 199 .ui-dialog .ui-dialog-titlebar { 200 padding: .4em 1em; 201 position: relative; 202 } 203 .ui-dialog .ui-dialog-title { 204 float: left; 205 margin: .1em 0; 161 /* WP buttons: see buttons.css. */ 162 163 .ui-button { 164 display: inline-block; 165 text-decoration: none; 166 font-size: 13px; 167 line-height: 26px; 168 height: 28px; 169 margin: 0; 170 padding: 0 10px 1px; 171 cursor: pointer; 172 border-width: 1px; 173 border-style: solid; 174 -webkit-appearance: none; 175 -webkit-border-radius: 3px; 176 border-radius: 3px; 206 177 white-space: nowrap; 207 width: 90%; 208 overflow: hidden; 209 text-overflow: ellipsis; 210 } 211 .ui-dialog .ui-dialog-titlebar-close { 212 position: absolute; 213 right: .3em; 214 top: 50%; 215 width: 21px; 216 margin: -10px 0 0 0; 217 padding: 1px; 218 height: 20px; 219 } 220 .ui-dialog .ui-dialog-content { 221 position: relative; 222 border: 0; 223 padding: .5em 1em; 224 background: none; 225 overflow: auto; 226 } 227 .ui-dialog .ui-dialog-buttonpane { 228 text-align: left; 229 border-width: 1px 0 0 0; 230 background-image: none; 231 margin-top: .5em; 232 padding: .3em 1em .5em .4em; 233 } 234 .ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { 235 float: right; 178 -webkit-box-sizing: border-box; 179 -moz-box-sizing: border-box; 180 box-sizing: border-box; 181 color: #555; 182 border-color: #cccccc; 183 background: #f7f7f7; 184 -webkit-box-shadow: inset 0 1px 0 #fff, 0 1px 0 rgba(0,0,0,.08); 185 box-shadow: inset 0 1px 0 #fff, 0 1px 0 rgba(0,0,0,.08); 186 vertical-align: top; 187 } 188 189 /* Remove the dotted border on :focus and the extra padding in Firefox */ 190 .ui-button::-moz-focus-inner { 191 border-width: 1px 0; 192 border-style: solid none; 193 border-color: transparent; 194 padding: 0; 236 195 } 237 .ui-dialog .ui-dialog-buttonpane button { 238 margin: .5em .4em .5em 0; 239 cursor: pointer; 196 197 .ui-button:hover { 198 background: #fafafa; 199 border-color: #999; 200 color: #222; 240 201 } 241 .ui-dialog .ui-resizable-se { 242 width: 12px; 243 height: 12px; 244 right: -5px; 245 bottom: -5px; 246 background-position: 16px 16px; 202 203 .ui-button:focus { 204 -webkit-box-shadow: 1px 1px 1px rgba(0,0,0,.2); 205 box-shadow: 1px 1px 1px rgba(0,0,0,.2); 247 206 } 248 .ui-draggable .ui-dialog-titlebar { 249 cursor: move; 207 208 .ui-button:active { 209 background: #eee; 210 border-color: #999; 211 color: #333; 212 -webkit-box-shadow: inset 0 2px 5px -3px rgba( 0, 0, 0, 0.5 ); 213 box-shadow: inset 0 2px 5px -3px rgba( 0, 0, 0, 0.5 ); 214 outline: none; 250 215 } 251 216 252 /* WP jQuery Dialog Theme */ 253 .wp-dialog { 254 padding: 0; 255 z-index: 100102; 256 border: 0; 257 -webkit-box-shadow: 0 5px 15px rgba(0,0,0,0.7); 258 box-shadow: 0 5px 15px rgba(0,0,0,0.7); 259 background-color: #f5f5f5; 217 .ui-button[disabled], 218 .ui-button:disabled { 219 color: #aaa !important; 220 border-color: #ddd !important; 221 background: #f7f7f7 !important; 222 -webkit-box-shadow: none !important; 223 box-shadow: none !important; 224 text-shadow: 0 1px 0 #fff !important; 225 cursor: default; 260 226 } 261 227 262 .wp-dialog .ui-dialog-title { 263 display: block; 264 text-align: center; 265 padding: 0; 228 @media screen and ( max-width: 782px ) { 229 230 .ui-button { 231 padding: 10px 14px; 232 line-height: 1; 233 font-size: 14px; 234 vertical-align: middle; 235 height: auto; 236 margin-bottom: 4px; 237 } 238 266 239 } 267 240 268 .wp-dialog .ui-dialog-titlebar { 269 padding: 0 1em; 270 background-color: #444; 271 font-size: 13px; 272 line-height: 24px; 273 color: #fff; 241 /* WP Theme */ 242 243 .ui-dialog { 244 position: absolute; 245 top: 0; 246 left: 0; 247 z-index: 100102; 248 background-color: #fff; 274 249 } 275 250 276 .wp-dialog .ui-dialog-content { 277 padding: 0; 251 .ui-dialog-titlebar { 252 background: #fcfcfc; 253 border-bottom: 1px solid #dfdfdf; 254 height: 56px; 255 font-size: 22px; 256 font-weight: 600; 257 line-height: 56px; 258 padding: 0 40px 0 16px; 278 259 } 279 260 280 .wp-dialog .ui-dialog-titlebar-close { 281 cursor: pointer; 282 -webkit-appearance: none; 283 border: 0; 284 width: 30px; 285 height: 20px; 286 top: 13px; 287 right: 6px; 261 .ui-button.ui-dialog-titlebar-close { 288 262 background: none; 263 border: none; 264 -webkit-box-shadow: none; 265 box-shadow: none; 266 color: #666; 267 cursor: pointer; 268 display: block; 269 padding: 0; 270 position: absolute; 271 top: 0; 272 right: 0; 273 width: 40px; 274 height: 40px; 275 text-align: center; 289 276 } 290 277 291 .wp-dialog .ui-dialog-titlebar-close:before { 292 content: '\f158'; 278 .ui-dialog-titlebar-close:before { 293 279 font: normal 20px/1 'dashicons'; 280 vertical-align: top; 294 281 speak: none; 295 282 -webkit-font-smoothing: antialiased; 296 283 -moz-osx-font-smoothing: grayscale; 297 color: #999; 298 padding-left: 12px; 284 line-height: 40px; 285 width: 40px; 286 height: 40px; 287 content: '\f158'; 299 288 } 300 289 301 . wp-dialog .ui-dialog-titlebar-close:hover:before{290 .ui-button.ui-dialog-titlebar-close:hover { 302 291 color: #2ea2cc; 303 292 } 304 293 305 . wp-dialog .ui-dialog-titlebar-close .ui-button-text {294 .ui-dialog-titlebar-close .ui-button-text { 306 295 display: none; 307 296 } 308 297 309 .wp-dialog .ui-dialog-titlebar-close:hover, 310 .wp-dialog .ui-dialog-titlebar-close:focus { 311 background-position: -87px -32px; 298 .ui-dialog-content { 299 padding: 16px; 300 overflow: auto; 301 } 302 303 .ui-dialog-buttonpane { 304 background: #fcfcfc; 305 border-top: 1px solid #dfdfdf; 306 padding: 16px; 307 } 308 309 .ui-dialog-buttonpane .ui-button { 310 margin-left: 16px; 311 } 312 313 .ui-dialog-buttonpane .ui-dialog-buttonset { 314 float: right; 315 } 316 317 .ui-draggable .ui-dialog-titlebar { 318 cursor: move; 312 319 } 313 320 314 321 .ui-widget-overlay { 322 position: fixed; 323 top: 0; 324 left: 0; 325 right: 0; 326 bottom: 0; 327 min-height: 360px; 328 background: #000; 329 opacity: 0.7; 315 330 z-index: 100101; 316 background-color: #000;317 opacity: 0.6;318 filter: alpha(opacity=60);319 331 } -
src/wp-includes/js/wplink.js
1 1 /* global ajaxurl, tinymce, wpLinkL10n, setUserSetting, wpActiveEditor */ 2 2 var wpLink; 3 3 4 ( function($){5 var inputs = {}, rivers = {}, ed , River, Query;4 ( function( $ ) { 5 var inputs = {}, rivers = {}, editor, River, Query; 6 6 7 7 wpLink = { 8 8 timeToTriggerRiver: 150, … … 12 12 lastSearch: '', 13 13 textarea: '', 14 14 15 init : function() { 16 inputs.dialog = $('#wp-link'); 17 inputs.submit = $('#wp-link-submit'); 15 init: function() { 16 inputs.wrap = $('#wp-link-wrap'); 17 inputs.dialog = $( '#wp-link' ); 18 inputs.backdrop = $( '#wp-link-backdrop' ); 19 inputs.submit = $( '#wp-link-submit' ); 20 inputs.close = $( '#wp-link-close' ); 18 21 // URL 19 inputs.url = $( '#url-field');20 inputs.nonce = $( '#_ajax_linking_nonce');22 inputs.url = $( '#url-field' ); 23 inputs.nonce = $( '#_ajax_linking_nonce' ); 21 24 // Secondary options 22 inputs.title = $( '#link-title-field');25 inputs.title = $( '#link-title-field' ); 23 26 // Advanced Options 24 inputs.openInNewTab = $( '#link-target-checkbox');25 inputs.search = $( '#search-field');27 inputs.openInNewTab = $( '#link-target-checkbox' ); 28 inputs.search = $( '#search-field' ); 26 29 // Build Rivers 27 rivers.search = new River( $( '#search-results') );28 rivers.recent = new River( $( '#most-recent-results') );29 rivers.elements = $('.query-results', inputs.dialog);30 rivers.search = new River( $( '#search-results' ) ); 31 rivers.recent = new River( $( '#most-recent-results' ) ); 32 rivers.elements = inputs.dialog.find( '.query-results' ); 30 33 31 34 // Bind event handlers 32 35 inputs.dialog.keydown( wpLink.keydown ); 33 36 inputs.dialog.keyup( wpLink.keyup ); 34 inputs.submit.click( function( e){35 e .preventDefault();37 inputs.submit.click( function( event ) { 38 event.preventDefault(); 36 39 wpLink.update(); 37 40 }); 38 $('#wp-link-cancel').click( function(e){39 e .preventDefault();41 inputs.close.add( inputs.backdrop ).click( function( event ) { 42 event.preventDefault(); 40 43 wpLink.close(); 41 44 }); 42 $('#internal-toggle').click( wpLink.toggleInternalLinking );43 45 44 rivers.elements.bind('river-select', wpLink.updateFields);46 $( '#wp-link-search-toggle' ).click( wpLink.toggleInternalLinking ); 45 47 46 inputs.search.keyup( wpLink.searchInternalLinks );48 rivers.elements.on( 'river-select', wpLink.updateFields ); 47 49 48 inputs.dialog.bind('wpdialogrefresh', wpLink.refresh); 49 inputs.dialog.bind('wpdialogbeforeopen', wpLink.beforeOpen); 50 inputs.dialog.bind('wpdialogclose', wpLink.onClose); 50 inputs.search.keyup( wpLink.searchInternalLinks ); 51 51 }, 52 52 53 beforeOpen : function() {53 open: function( editorId ) { 54 54 wpLink.range = null; 55 55 56 if ( ! wpLink.isMCE() && document.selection ) {57 wpLink.textarea.focus();58 wpLink.range = document.selection.createRange();59 }60 },61 62 open : function( editorId ) {63 56 if ( editorId ) { 64 57 window.wpActiveEditor = editorId; 65 58 } … … 68 61 return; 69 62 } 70 63 71 this.textarea = $( '#' + w pActiveEditor ).get(0);64 this.textarea = $( '#' + window.wpActiveEditor ).get( 0 ); 72 65 73 66 if ( typeof tinymce !== 'undefined' ) { 74 ed = tinymce.get( wpActiveEditor );67 editor = tinymce.get( wpActiveEditor ); 75 68 76 if ( ed && tinymce.isIE ) {77 ed .windowManager.bookmark = ed.selection.getBookmark();69 if ( editor && tinymce.isIE ) { 70 editor.windowManager.bookmark = editor.selection.getBookmark(); 78 71 } 79 72 } 80 73 81 // Initialize the dialog 82 if ( ! inputs.dialog.data('wpdialog') ) { 83 inputs.dialog.wpdialog({ 84 title: wpLinkL10n.title, 85 width: 480, 86 height: 'auto', 87 modal: true, 88 dialogClass: 'wp-dialog' 89 }); 74 if ( ! wpLink.isMCE() && document.selection ) { 75 this.textarea.focus(); 76 this.range = document.selection.createRange(); 90 77 } 91 78 92 inputs.dialog.wpdialog('open'); 79 inputs.wrap.show(); 80 inputs.backdrop.show(); 81 82 wpLink.refresh(); 93 83 }, 94 84 95 isMCE 96 return ed && ! ed.isHidden();85 isMCE: function() { 86 return editor && ! editor.isHidden(); 97 87 }, 98 88 99 refresh 89 refresh: function() { 100 90 // Refresh rivers (clear links, check visibility) 101 91 rivers.search.refresh(); 102 92 rivers.recent.refresh(); … … 119 109 var e; 120 110 121 111 // If link exists, select proper values. 122 if ( e = ed .dom.getParent( ed.selection.getNode(), 'A' ) ) {112 if ( e = editor.dom.getParent( editor.selection.getNode(), 'A' ) ) { 123 113 // Set URL and description. 124 inputs.url.val( ed .dom.getAttrib( e, 'href' ) );125 inputs.title.val( ed .dom.getAttrib( e, 'title' ) );114 inputs.url.val( editor.dom.getAttrib( e, 'href' ) ); 115 inputs.title.val( editor.dom.getAttrib( e, 'title' ) ); 126 116 // Set open in new tab. 127 inputs.openInNewTab.prop( 'checked', ( '_blank' === ed .dom.getAttrib( e, 'target' ) ) );117 inputs.openInNewTab.prop( 'checked', ( '_blank' === editor.dom.getAttrib( e, 'target' ) ) ); 128 118 // Update save prompt. 129 119 inputs.submit.val( wpLinkL10n.update ); 130 120 … … 135 125 }, 136 126 137 127 close: function() { 138 inputs.dialog.wpdialog('close');139 },140 141 onClose: function() {142 128 if ( ! wpLink.isMCE() ) { 143 129 wpLink.textarea.focus(); 144 130 … … 147 133 wpLink.range.select(); 148 134 } 149 135 } 136 137 inputs.backdrop.hide(); 138 inputs.wrap.hide(); 150 139 }, 151 140 152 141 getAttrs: function() { 153 142 return { 154 href 155 title 156 target : inputs.openInNewTab.prop('checked') ? '_blank' : ''143 href: inputs.url.val(), 144 title: inputs.title.val(), 145 target: inputs.openInNewTab.prop( 'checked' ) ? '_blank' : '' 157 146 }; 158 147 }, 159 148 … … 230 219 attrs = wpLink.getAttrs(); 231 220 232 221 wpLink.close(); 233 ed .focus();222 editor.focus(); 234 223 235 224 if ( tinymce.isIE ) { 236 ed .selection.moveToBookmark( ed.windowManager.bookmark );225 editor.selection.moveToBookmark( editor.windowManager.bookmark ); 237 226 } 238 227 239 link = ed .dom.getParent( ed.selection.getNode(), 'a[href]' );228 link = editor.dom.getParent( editor.selection.getNode(), 'a[href]' ); 240 229 241 230 // If the values are empty, unlink and return 242 231 if ( ! attrs.href || attrs.href == 'http://' ) { 243 ed .execCommand('unlink');232 editor.execCommand( 'unlink' ); 244 233 return; 245 234 } 246 235 247 236 if ( link ) { 248 ed .dom.setAttribs( link, attrs );237 editor.dom.setAttribs( link, attrs ); 249 238 } else { 250 ed .execCommand( 'mceInsertLink', false, attrs );239 editor.execCommand( 'mceInsertLink', false, attrs ); 251 240 } 252 241 253 242 // Move the cursor to the end of the selection 254 ed .selection.collapse();243 editor.selection.collapse(); 255 244 }, 256 245 257 246 updateFields: function( e, li, originalEvent ) { 258 inputs.url.val( li.children( '.item-permalink').val() );259 inputs.title.val( li.hasClass( 'no-title') ? '' : li.children('.item-title').text() );247 inputs.url.val( li.children( '.item-permalink' ).val() ); 248 inputs.title.val( li.hasClass( 'no-title' ) ? '' : li.children( '.item-title' ).text() ); 260 249 if ( originalEvent && originalEvent.type == 'click' ) 261 250 inputs.url.focus(); 262 251 }, … … 264 253 setDefaultValues: function() { 265 254 // Set URL and description to defaults. 266 255 // Leave the new tab setting as-is. 267 inputs.url.val( 'http://');268 inputs.title.val( '');256 inputs.url.val( 'http://' ); 257 inputs.title.val( '' ); 269 258 270 259 // Update save prompt. 271 260 inputs.submit.val( wpLinkL10n.save ); 272 261 }, 273 262 274 263 searchInternalLinks: function() { 275 var t = $( this), waiting,264 var t = $( this ), waiting, 276 265 search = t.val(); 277 266 278 267 if ( search.length > 2 ) { … … 284 273 return; 285 274 286 275 wpLink.lastSearch = search; 287 waiting = t.parent().find('.spinner').show();276 waiting = $( '#river-waiting' ).show(); 288 277 289 278 rivers.search.change( search ); 290 rivers.search.ajax( function(){ waiting.hide(); }); 279 rivers.search.ajax( function() { 280 waiting.hide(); 281 }); 291 282 } else { 292 283 rivers.search.hide(); 293 284 rivers.recent.show(); … … 343 334 return func.apply( funcContext, funcArgs ); 344 335 // Otherwise, wait. 345 336 timeoutTriggered = true; 346 }, delay );337 }, delay ); 347 338 348 339 return function() { 349 340 if ( timeoutTriggered ) … … 355 346 }; 356 347 }, 357 348 358 toggleInternalLinking: function( event ) { 359 var panel = $('#search-panel'), 360 widget = inputs.dialog.wpdialog('widget'), 361 // We're about to toggle visibility; it's currently the opposite 362 visible = !panel.is(':visible'), 363 win = $(window); 364 365 $(this).toggleClass('toggle-arrow-active', visible); 366 367 inputs.dialog.height('auto'); 368 panel.slideToggle( 300, function() { 369 setUserSetting('wplink', visible ? '1' : '0'); 370 inputs[ visible ? 'search' : 'url' ].focus(); 371 372 // Move the box if the box is now expanded, was opened in a collapsed state, 373 // and if it needs to be moved. (Judged by bottom not being positive or 374 // bottom being smaller than top.) 375 var scroll = win.scrollTop(), 376 top = widget.offset().top, 377 bottom = top + widget.outerHeight(), 378 diff = bottom - win.height(); 349 toggleInternalLinking: function() { 350 var visible = inputs.wrap.hasClass( 'search-panel-visible' ); 379 351 380 if ( diff > scroll ) { 381 widget.animate({'top': diff < top ? top - diff : scroll }, 200); 382 } 383 }); 384 event.preventDefault(); 352 inputs.wrap.toggleClass( 'search-panel-visible', ! visible ); 353 setUserSetting( 'wplink', visible ? '0' : '1' ); 354 inputs[ ! visible ? 'search' : 'url' ].focus(); 385 355 } 386 356 }; 387 357 388 358 River = function( element, search ) { 389 359 var self = this; 390 360 this.element = element; 391 this.ul = element.children('ul'); 392 this.waiting = element.find('.river-waiting'); 361 this.ul = element.children( 'ul' ); 362 this.contentHeight = element.children( '#link-selector-height' ); 363 this.waiting = $( '#river-waiting' ); 393 364 394 365 this.change( search ); 395 366 this.refresh(); 396 367 397 element.scroll( function(){ self.maybeLoad(); }); 398 element.delegate('li', 'click', function(e){ self.select( $(this), e ); }); 368 $( '#wp-link .query-results, #wp-link #link-selector' ).scroll( function() { 369 self.maybeLoad(); 370 }); 371 element.on( 'click', 'li', function( event ) { 372 self.select( $( this ), event ); 373 }); 399 374 }; 400 375 401 376 $.extend( River.prototype, { 402 377 refresh: function() { 403 378 this.deselect(); 404 this.visible = this.element.is( ':visible');379 this.visible = this.element.is( ':visible' ); 405 380 }, 406 381 show: function() { 407 382 if ( ! this.visible ) { … … 418 393 select: function( li, event ) { 419 394 var liHeight, elHeight, liTop, elTop; 420 395 421 if ( li.hasClass( 'unselectable') || li == this.selected )396 if ( li.hasClass( 'unselectable' ) || li == this.selected ) 422 397 return; 423 398 424 399 this.deselect(); 425 this.selected = li.addClass( 'selected');400 this.selected = li.addClass( 'selected' ); 426 401 // Make sure the element is visible 427 402 liHeight = li.outerHeight(); 428 403 elHeight = this.element.height(); … … 435 410 this.element.scrollTop( elTop + liTop - elHeight + liHeight ); 436 411 437 412 // Trigger the river-select event 438 this.element.trigger( 'river-select', [ li, event, this ]);413 this.element.trigger( 'river-select', [ li, event, this ] ); 439 414 }, 440 415 deselect: function() { 441 416 if ( this.selected ) 442 this.selected.removeClass( 'selected');417 this.selected.removeClass( 'selected' ); 443 418 this.selected = false; 444 419 }, 445 420 prev: function() { … … 448 423 449 424 var to; 450 425 if ( this.selected ) { 451 to = this.selected.prev( 'li');426 to = this.selected.prev( 'li' ); 452 427 if ( to.length ) 453 428 this.select( to ); 454 429 } … … 457 432 if ( ! this.visible ) 458 433 return; 459 434 460 var to = this.selected ? this.selected.next( 'li') : $('li:not(.unselectable):first', this.element);435 var to = this.selected ? this.selected.next( 'li' ) : $( 'li:not(.unselectable):first', this.element ); 461 436 if ( to.length ) 462 437 this.select( to ); 463 438 }, … … 478 453 479 454 this._search = search; 480 455 this.query = new Query( search ); 481 this.element.scrollTop( 0);456 this.element.scrollTop( 0 ); 482 457 }, 483 458 process: function( results, params ) { 484 459 var list = '', alt = true, classes = '', 485 460 firstPage = params.page == 1; 486 461 487 if ( ! results ) {462 if ( ! results ) { 488 463 if ( firstPage ) { 489 464 list += '<li class="unselectable"><span class="item-title"><em>' + 490 465 wpLinkL10n.noMatchesFound + '</em></span></li>'; … … 509 484 el = this.element, 510 485 bottom = el.scrollTop() + el.height(); 511 486 512 if ( ! this.query.ready() || bottom < this. ul.height() - wpLink.riverBottomThreshold )487 if ( ! this.query.ready() || bottom < this.contentHeight.height() - wpLink.riverBottomThreshold ) 513 488 return; 514 489 515 490 setTimeout(function() { 516 491 var newTop = el.scrollTop(), 517 492 newBottom = newTop + el.height(); 518 493 519 if ( ! self.query.ready() || newBottom < self. ul.height() - wpLink.riverBottomThreshold )494 if ( ! self.query.ready() || newBottom < self.contentHeight.height() - wpLink.riverBottomThreshold ) 520 495 return; 521 496 522 497 self.waiting.show(); 523 498 el.scrollTop( newTop + self.waiting.outerHeight() ); 524 499 525 self.ajax( function() { self.waiting.hide(); }); 500 self.ajax( function() { 501 self.waiting.hide(); 502 }); 526 503 }, wpLink.timeToTriggerRiver ); 527 504 } 528 505 }); … … 536 513 537 514 $.extend( Query.prototype, { 538 515 ready: function() { 539 return ! ( this.querying || this.allLoaded );516 return ! ( this.querying || this.allLoaded ); 540 517 }, 541 518 ajax: function( callback ) { 542 519 var self = this, … … 551 528 552 529 this.querying = true; 553 530 554 $.post( ajaxurl, query, function( r) {531 $.post( ajaxurl, query, function( r ) { 555 532 self.page++; 556 533 self.querying = false; 557 self.allLoaded = ! r;534 self.allLoaded = ! r; 558 535 callback( r, query ); 559 536 }, 'json' ); 560 537 } 561 538 }); 562 539 563 $( document).ready( wpLink.init );564 })( jQuery);540 $( document ).ready( wpLink.init ); 541 })( jQuery ); -
src/wp-includes/script-loader.php
338 338 339 339 $scripts->add( 'admin-bar', "/wp-includes/js/admin-bar$suffix.js", array(), false, 1 ); 340 340 341 $scripts->add( 'wplink', "/wp-includes/js/wplink$suffix.js", array( 'jquery' , 'wpdialogs'), false, 1 );341 $scripts->add( 'wplink', "/wp-includes/js/wplink$suffix.js", array( 'jquery' ), false, 1 ); 342 342 did_action( 'init' ) && $scripts->localize( 'wplink', 'wpLinkL10n', array( 343 343 'title' => __('Insert/edit link'), 344 344 'update' => __('Update'),