Ticket #26952: 26952.7.patch
File 26952.7.patch, 40.3 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> 1041 $show_internal = '1' == get_user_setting( 'wplink', '0' ); 1042 ?> 1043 <div id="wp-link-backdrop"></div> 1044 <form id="wp-link"<?php if ( $show_internal ) echo ' class="search-toggled"'; ?> tabindex="-1"> 1045 <?php wp_nonce_field( 'internal-linking', '_ajax_linking_nonce', false ); ?> 1046 <div id="link-modal-title"> 1047 <?php _e( 'Insert/edit link' ) ?> 1048 <div id="wp-link-close"></div> 1070 1049 </div> 1071 <div id="search-results" class="query-results"> 1072 <ul></ul> 1073 <div class="river-waiting"> 1074 <span class="spinner"></span> 1050 <div id="link-selector"> 1051 <div id="link-selector-height"> 1052 <label for="url-field"> 1053 <?php _e( 'Destination URL' ); ?> 1054 <input id="url-field" type="text" name="href" /> 1055 </label> 1056 <label for="link-title-field"> 1057 <?php _e( 'Title attribute' ); ?> 1058 <input id="link-title-field" type="text" name="linktitle" /> 1059 </label> 1060 <label for="link-target-checkbox"> 1061 <input type="checkbox" id="link-target-checkbox" /> 1062 <?php _e( 'Open link in a new window/tab' ); ?> 1063 </label> 1064 <label for="search-field"> 1065 <span id="wp-link-search-toggle"><?php _e( 'Or link to existing content' ); ?></span> 1066 <input type="search" id="search-field" class="link-search-field" autocomplete="off" /> 1067 <span class="spinner"></span> 1068 </label> 1069 <div id="search-panel"> 1070 <div id="search-results" class="query-results"> 1071 <ul></ul> 1072 </div> 1073 <div id="most-recent-results" class="query-results"> 1074 <div class="query-notice"><em><?php _e( 'No search term specified. Showing recent items.' ); ?></em></div> 1075 <ul></ul> 1076 </div> 1077 <div id="river-waiting"> 1078 <span class="spinner"></span> 1079 </div> 1080 </div> 1075 1081 </div> 1076 1082 </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> 1082 </div> 1083 <div class="submitbox"> 1084 <input type="submit" value="<?php esc_attr_e( 'Add Link' ); ?>" class="button button-primary" id="wp-link-submit" name="wp-link-submit"> 1083 1085 </div> 1084 </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> 1090 <div id="wp-link-cancel"> 1091 <a class="submitdelete deletion" href="#"><?php _e( 'Cancel' ); ?></a> 1092 </div> 1093 </div> 1094 </form> 1095 </div> 1096 <?php 1086 </form> 1087 <?php 1097 1088 } 1098 1089 } -
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
308 308 } 309 309 310 310 /* Buttons in modals */ 311 .mce- primarybutton,312 .mce- primarybutton i {311 .mce-btn button, 312 .mce-btn button i { 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 { 319 color: #555; 320 background: #f7f7f7; 321 display: inline-block; 321 322 text-decoration: none; 322 323 font-size: 13px; 323 324 line-height: 26px; 324 height: 28px ;325 height: 28px!important; 325 326 margin: 0; 326 padding: 0 ;327 padding: 0 10px 1px; 327 328 cursor: pointer; 328 border: 1px solid #ccc; 329 border-width: 1px; 330 border-style: solid; 329 331 -webkit-appearance: none; 330 332 -webkit-border-radius: 3px; 331 333 border-radius: 3px; 332 334 white-space: nowrap; 335 -webkit-box-sizing: border-box; 336 -moz-box-sizing: border-box; 337 box-sizing: border-box; 338 color: #555; 339 border-color: #cccccc; 340 background: #f7f7f7; 333 341 -webkit-box-shadow: inset 0 1px 0 #fff, 0 1px 0 rgba(0,0,0,.08); 334 342 box-shadow: inset 0 1px 0 #fff, 0 1px 0 rgba(0,0,0,.08); 335 background-image: none; 343 vertical-align: top; 344 } 345 346 /* Remove the dotted border on :focus and the extra padding in Firefox */ 347 .mce-window .mce-btn::-moz-focus-inner { 348 border-width: 1px 0; 349 border-style: solid none; 350 border-color: transparent; 351 padding: 0; 336 352 } 337 353 338 354 .mce-window .mce-btn:hover { … … 352 368 color: #333; 353 369 -webkit-box-shadow: inset 0 2px 5px -3px rgba( 0, 0, 0, 0.5 ); 354 370 box-shadow: inset 0 2px 5px -3px rgba( 0, 0, 0, 0.5 ); 371 outline: none; 355 372 } 356 373 374 .mce-window .mce-btn[disabled], 375 .mce-window .mce-btn:disabled, 357 376 .mce-window .mce-btn.mce-disabled { 358 color: #aaa; 359 border-color: #ddd; 360 -webkit-box-shadow: none; 361 box-shadow: none; 362 text-shadow: 0 1px 0 #fff; 377 color: #aaa !important; 378 border-color: #ddd !important; 379 background: #f7f7f7 !important; 380 -webkit-box-shadow: none !important; 381 box-shadow: none !important; 382 text-shadow: 0 1px 0 #fff !important; 363 383 cursor: default; 364 384 } 365 385 366 386 .mce-window .mce-btn.mce-primary { 367 387 background: #2ea2cc; 368 388 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; 389 -webkit-box-shadow: inset 0 1px 0 rgba(120,200,230,0.5), 0 1px 0 rgba(0,0,0,.15); 390 box-shadow: inset 0 1px 0 rgba(120,200,230,0.5), 0 1px 0 rgba(0,0,0,.15); 391 color: #fff; 392 text-decoration: none; 372 393 } 373 394 374 .mce-window .mce-btn.mce-primary:hover { 395 .mce-window .mce-btn.mce-primary:hover, 396 .mce-window .mce-btn.mce-primary:focus { 375 397 background: #1e8cbe; 376 398 border-color: #0074a2; 377 378 399 -webkit-box-shadow: inset 0 1px 0 rgba(120,200,230,0.6); 400 box-shadow: inset 0 1px 0 rgba(120,200,230,0.6); 379 401 color: #fff; 380 402 } 381 403 … … 389 411 background: #1b7aa6; 390 412 border-color: #005684; 391 413 color: rgba(255,255,255,0.95); 392 -webkit-box-shadow: inset 0 1px 0 rgba(0,0,0,0.1); 393 box-shadow: inset 0 1px 0 rgba(0,0,0,0.1); 414 -webkit-box-shadow: inset 0 1px 0 rgba(0,0,0,0.1); 415 box-shadow: inset 0 1px 0 rgba(0,0,0,0.1); 416 vertical-align: top; 394 417 } 395 418 419 .mce-window .mce-btn.mce-primary[disabled], 420 .mce-window .mce-btn.mce-primary:disabled, 396 421 .mce-window .mce-btn.mce-primary.mce-disabled { 397 color: #94cde7; 398 background: #298cba; 399 border-color: #1b607f; 400 text-shadow: 0 -1px 0 rgba(0,0,0,0.1); 422 color: #94cde7 !important; 423 background: #298cba !important; 424 border-color: #1b607f !important; 425 -webkit-box-shadow: none !important; 426 box-shadow: none !important; 427 text-shadow: 0 -1px 0 rgba(0,0,0,0.1) !important; 428 cursor: default; 429 } 430 431 @media screen and ( max-width: 782px ) { 432 433 .mce-window .mce-btn { 434 padding: 10px 14px; 435 line-height: 1; 436 font-size: 14px; 437 vertical-align: middle; 438 height: auto; 439 margin-bottom: 4px; 440 } 441 401 442 } 402 443 403 444 /* Charmap modal */ … … 860 901 background-color: #ccc; 861 902 } 862 903 863 /*------------------------------------------------------------------------------ 864 wp-link 865 ------------------------------------------------------------------------------*/ 866 867 #wp-link { 868 background-color: #F5F5F5; 869 line-height: 1.4em; 870 font-size: 12px; 871 } 872 873 #wp-link ol, 874 #wp-link ul { 875 list-style: none; 876 margin: 0; 877 padding: 0; 904 /* Link modal */ 905 #wp-link-backdrop { 906 display: none; 907 position: fixed; 908 top: 0; 909 left: 0; 910 right: 0; 911 bottom: 0; 912 min-height: 360px; 913 background: #000; 914 opacity: 0.7; 915 z-index: 159900; 878 916 } 879 917 880 #wp-link input[type="text"] { 881 -webkit-box-sizing: border-box; 882 -moz-box-sizing: border-box; 883 box-sizing: border-box; 918 #wp-link { /* NOTE: changing some of these values requires a chnage in wplink.js */ 919 display: none; 920 position: fixed; 921 top: 50%; 922 left: 0; 923 right: 0; 924 bottom: 0; 925 z-index: 160000; 926 height: 340px; 927 width: 600px; 928 background-color: #fff; 929 margin: -170px auto 0; 930 overflow: hidden; 884 931 } 885 932 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; 933 #wp-link.search-toggled { /* NOTE: see block above. */ 934 margin-top: 0px; 935 top: 30px; 936 bottom: 30px; 937 height: auto; 895 938 } 896 939 897 # wp-link #link-options{898 padding: 10px 0 14px;940 #link-modal-title { 941 background: #fcfcfc; 899 942 border-bottom: 1px solid #dfdfdf; 900 margin: 0 6px 14px; 943 height: 56px; 944 font-size: 22px; 945 font-weight: 600; 946 line-height: 56px; 947 padding: 0 40px 0 16px; 948 position: absolute; 949 top: 0; 950 right: 0; 951 left: 0; 901 952 } 902 953 903 #wp-link p.howto { 904 margin: 3px; 954 #wp-link-close { 955 color: #666; 956 cursor: pointer; 957 padding: 0; 958 position: absolute; 959 top: 0; 960 right: 0; 961 width: 40px; 962 height: 40px; 963 text-align: center; 905 964 } 906 965 907 #wp-link #internal-toggle { 908 display: inline-block; 909 cursor: pointer; 910 padding-left: 18px; 966 #wp-link-close:before { 967 font: normal 20px/1 'dashicons'; 968 vertical-align: top; 969 speak: none; 970 -webkit-font-smoothing: antialiased; 971 -moz-osx-font-smoothing: grayscale; 972 line-height: 40px; 973 width: 40px; 974 height: 40px; 975 content: '\f158'; 911 976 } 912 977 913 #wp-link .toggle-arrow { 914 background: transparent url(../images/toggle-arrow.png) top left no-repeat; 915 height: 23px; 916 line-height: 23px; 978 #wp-link-close:hover { 979 color: #2ea2cc; 917 980 } 918 981 919 #wp-link .toggle-arrow-active { 920 background-position: center left; 982 #link-selector { 983 padding: 0 16px; 984 position: absolute; 985 top: 57px; 986 right: 0; 987 bottom: 61px; 988 left: 0; 989 overflow-y: scroll; 921 990 } 922 991 923 #wp-link label input[type="text"] { 924 width: 360px; 925 margin-top: 5px; 992 #wp-link ol, 993 #wp-link ul { 994 list-style: none; 995 margin: 0; 996 padding: 0; 926 997 } 927 998 928 #wp-link #link-options label span, 929 #wp-link #search-panel label span.search-label { 930 display: inline-block; 931 width: 80px; 932 text-align: right; 933 padding-right: 5px; 999 #wp-link label, 1000 #search-panel { 1001 display: block; 1002 margin: 16px 0; 934 1003 } 935 1004 936 #wp-link .link-search-field { 937 float: left; 938 width: 220px; 1005 #wp-link label input[type="text"], 1006 #wp-link label input[type="search"] { 1007 margin: 4px 0 0; 1008 width: 100%; 939 1009 } 940 1010 941 #wp-link .link-search-wrapper { 942 margin: 5px 6px 9px; 943 display: block; 944 overflow: hidden; 1011 #search-panel, 1012 #search-field, 1013 #search-results, 1014 #river-waiting { 1015 display: none; 945 1016 } 946 1017 947 #wp-link .link-search-wrapper span { 948 float: left; 949 margin-top: 4px;1018 .search-toggled #search-panel, 1019 .search-toggled #search-field { 1020 display: block; 950 1021 } 951 1022 952 #wp-link .link-search-wrapper .spinner { 953 display: none; 954 vertical-align: text-bottom; 1023 #wp-link-search-toggle::after { 1024 font: normal 20px/1 'dashicons'; 1025 vertical-align: top; 1026 speak: none; 1027 -webkit-font-smoothing: antialiased; 1028 -moz-osx-font-smoothing: grayscale; 1029 content: '\f140'; 955 1030 } 956 1031 957 #wp-link .link-target { 958 width: auto; 959 padding: 3px 0 0; 960 margin: 0 0 0 87px; 961 font-size: 11px; 1032 .search-toggled #wp-link-search-toggle::after { 1033 content: '\f142'; 962 1034 } 963 1035 964 1036 #wp-link .query-results { 965 border: 1px #dfdfdf solid; 966 margin: 0 5px 5px; 967 background: #fff; 968 height: 185px; 969 overflow: auto; 970 position: relative; 1037 border: 1px #f1f1f1 solid; 971 1038 } 972 1039 973 1040 #wp-link li, … … 977 1044 border-bottom: 1px solid #f1f1f1; 978 1045 color: #333; 979 1046 padding: 4px 6px; 980 cursor: pointer;981 1047 position: relative; 982 1048 } 983 1049 984 #wp-link li:hover { 985 background: #eaf2fa; 986 color: #151515; 1050 #wp-link li { 1051 cursor: pointer; 987 1052 } 988 1053 989 1054 #wp-link li.unselectable { 990 border-bottom: 1px solid #dfdfdf;1055 cursor: default; 991 1056 } 992 1057 993 #wp-link li.unselectable:hover { 994 background: #fff; 995 cursor: auto; 996 color: #333; 1058 #wp-link li:hover { 1059 background: #eaf2fa; 997 1060 } 998 1061 999 1062 #wp-link li.selected { 1000 background: #ddd; 1001 color: #333; 1063 background: #f1f1f1; 1002 1064 } 1003 1065 1004 1066 #wp-link li.selected .item-title { 1005 1067 font-weight: bold; 1006 1068 } 1007 1069 1070 #wp-link li:last-of-type { 1071 border: none; 1072 } 1073 1008 1074 #wp-link .item-title { 1009 1075 display: inline-block; 1010 1076 width: 80%; … … 1020 1086 bottom: 0; 1021 1087 } 1022 1088 1023 #wp-link #search-results { 1024 display: none; 1025 } 1026 1027 #wp-link #search-panel { 1028 float: left; 1029 width: 100%; 1030 } 1031 1032 #wp-link .river-waiting { 1033 display: none; 1034 padding: 10px 0; 1035 } 1036 1037 #wp-link .river-waiting .spinner { 1038 margin: 0 auto; 1089 #river-waiting .spinner { 1090 margin: 8px auto 0; 1039 1091 display: block; 1092 float: none; 1040 1093 } 1041 1094 1042 1095 #wp-link .submitbox { 1043 padding: 5px 10px; 1044 font-size: 11px; 1045 overflow: auto; 1046 height: 29px; 1047 } 1048 1049 #wp-link-cancel { 1050 line-height: 25px; 1051 float: left; 1052 } 1053 1054 #wp-link-update { 1055 line-height: 23px; 1056 float: right; 1057 } 1058 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; 1096 background: #fcfcfc; 1097 border-top: 1px solid #dfdfdf; 1098 padding: 16px; 1112 1099 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; 1100 right: 0; 1101 bottom: 0; 1148 1102 left: 0; 1149 width: 100%;1150 height: 100%;1151 1103 } 1152 1104 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 { 1105 #wp-link-submit { 1287 1106 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; 1326 } 1327 1328 .wp-dialog .ui-dialog-content { 1329 padding: 0; 1330 } 1331 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 } 1342 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 } 1352 1353 .wp-dialog .ui-dialog-titlebar-close:hover:before { 1354 color: #2ea2cc; 1107 margin-bottom: 0; 1355 1108 } 1356 1109 1357 .wp-dialog .ui-dialog-titlebar-close .ui-button-text { 1358 display: none; 1359 } 1110 @media screen and ( max-width: 782px ) { 1360 1111 1361 .wp-dialog .ui-dialog-titlebar-close:hover, 1362 .wp-dialog .ui-dialog-titlebar-close:focus { 1363 background-position: -87px -32px; 1364 } 1112 #wp-link, 1113 #wp-link.search-toggled { 1114 margin: 0!important; /* Overwrite inline styles created with js. */ 1115 height: auto!important; 1116 width: auto; 1117 top: 10px!important; 1118 left: 10px; 1119 right: 10px; 1120 bottom: 10px!important; /* ^ */ 1121 } 1122 1123 #link-selector { 1124 bottom: 69px; 1125 } 1365 1126 1366 .ui-widget-overlay {1367 z-index: 300001;1368 background-color: #000;1369 opacity: 0.6;1370 filter: alpha(opacity=60);1371 1127 } 1372 1128 1373 1129 /* TinyMCE modal */ … … 1807 1563 font-family: Arial, sans-serif; 1808 1564 } 1809 1565 1810 1811 1566 /* HiDPI */ 1812 1567 @media print, 1813 1568 (-o-min-device-pixel-ratio: 5/4), … … 1817 1572 #wp-fullscreen-buttons #wp_fs_image span.mce_image { 1818 1573 background: none; 1819 1574 } 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 1575 } 1827 1576 1828 1577 /* 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($){4 ( function( $ ) { 5 5 var inputs = {}, rivers = {}, ed, River, Query; 6 6 7 7 wpLink = { … … 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.dialog = $( '#wp-link' ); 17 inputs.backdrop = $( '#wp-link-backdrop' ); 18 inputs.submit = $( '#wp-link-submit' ); 19 inputs.close = $( '#wp-link-close' ); 18 20 // URL 19 inputs.url = $( '#url-field');20 inputs.nonce = $( '#_ajax_linking_nonce');21 inputs.url = $( '#url-field' ); 22 inputs.nonce = $( '#_ajax_linking_nonce' ); 21 23 // Secondary options 22 inputs.title = $( '#link-title-field');24 inputs.title = $( '#link-title-field' ); 23 25 // Advanced Options 24 inputs.openInNewTab = $( '#link-target-checkbox');25 inputs.search = $( '#search-field');26 inputs.openInNewTab = $( '#link-target-checkbox' ); 27 inputs.search = $( '#search-field' ); 26 28 // Build Rivers 27 rivers.search = new River( $( '#search-results') );28 rivers.recent = new River( $( '#most-recent-results') );29 rivers.elements = $( '.query-results', inputs.dialog);29 rivers.search = new River( $( '#search-results' ) ); 30 rivers.recent = new River( $( '#most-recent-results' ) ); 31 rivers.elements = $( '.query-results', inputs.dialog ); 30 32 31 33 // Bind event handlers 32 34 inputs.dialog.keydown( wpLink.keydown ); 33 35 inputs.dialog.keyup( wpLink.keyup ); 34 inputs.submit.click( function( e){35 e .preventDefault();36 inputs.submit.click( function( event ) { 37 event.preventDefault(); 36 38 wpLink.update(); 37 39 }); 38 $('#wp-link-cancel').click( function(e){39 e .preventDefault();40 inputs.close.add( inputs.backdrop ).click( function( event ) { 41 event.preventDefault(); 40 42 wpLink.close(); 41 43 }); 42 $('#internal-toggle').click( wpLink.toggleInternalLinking );43 44 44 rivers.elements.bind('river-select', wpLink.updateFields);45 $( '#wp-link-search-toggle' ).click( wpLink.toggleInternalLinking ); 45 46 46 inputs.search.keyup( wpLink.searchInternalLinks );47 rivers.elements.on( 'river-select', wpLink.updateFields ); 47 48 48 inputs.dialog.bind('wpdialogrefresh', wpLink.refresh); 49 inputs.dialog.bind('wpdialogbeforeopen', wpLink.beforeOpen); 50 inputs.dialog.bind('wpdialogclose', wpLink.onClose); 49 inputs.search.keyup( wpLink.searchInternalLinks ); 51 50 }, 52 51 53 beforeOpen : function() {52 open: function( editorId ) { 54 53 wpLink.range = null; 55 54 56 55 if ( ! wpLink.isMCE() && document.selection ) { 57 56 wpLink.textarea.focus(); 58 57 wpLink.range = document.selection.createRange(); 59 58 } 60 },61 59 62 open : function( editorId ) {63 60 if ( editorId ) { 64 61 window.wpActiveEditor = editorId; 65 62 } … … 68 65 return; 69 66 } 70 67 71 this.textarea = $( '#' + wpActiveEditor ).get( 0);68 this.textarea = $( '#' + wpActiveEditor ).get( 0 ); 72 69 73 70 if ( typeof tinymce !== 'undefined' ) { 74 71 ed = tinymce.get( wpActiveEditor ); … … 78 75 } 79 76 } 80 77 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 }); 90 } 91 92 inputs.dialog.wpdialog('open'); 78 inputs.backdrop.fadeIn(); 79 inputs.dialog.fadeIn(); 80 81 wpLink.refresh(); 93 82 }, 94 83 95 isMCE 84 isMCE: function() { 96 85 return ed && ! ed.isHidden(); 97 86 }, 98 87 99 refresh 88 refresh: function() { 100 89 // Refresh rivers (clear links, check visibility) 101 90 rivers.search.refresh(); 102 91 rivers.recent.refresh(); … … 135 124 }, 136 125 137 126 close: function() { 138 inputs.dialog.wpdialog('close');139 },140 141 onClose: function() {142 127 if ( ! wpLink.isMCE() ) { 143 128 wpLink.textarea.focus(); 144 129 … … 147 132 wpLink.range.select(); 148 133 } 149 134 } 135 inputs.dialog.fadeOut(); 136 inputs.backdrop.fadeOut(); 150 137 }, 151 138 152 139 getAttrs: function() { 153 140 return { 154 href 155 title 156 target : inputs.openInNewTab.prop('checked') ? '_blank' : ''141 href: inputs.url.val(), 142 title: inputs.title.val(), 143 target: inputs.openInNewTab.prop( 'checked' ) ? '_blank' : '' 157 144 }; 158 145 }, 159 146 … … 240 227 241 228 // If the values are empty, unlink and return 242 229 if ( ! attrs.href || attrs.href == 'http://' ) { 243 ed.execCommand( 'unlink');230 ed.execCommand( 'unlink' ); 244 231 return; 245 232 } 246 233 … … 255 242 }, 256 243 257 244 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() );245 inputs.url.val( li.children( '.item-permalink' ).val() ); 246 inputs.title.val( li.hasClass( 'no-title' ) ? '' : li.children( '.item-title' ).text() ); 260 247 if ( originalEvent && originalEvent.type == 'click' ) 261 248 inputs.url.focus(); 262 249 }, … … 264 251 setDefaultValues: function() { 265 252 // Set URL and description to defaults. 266 253 // Leave the new tab setting as-is. 267 inputs.url.val( 'http://');268 inputs.title.val( '');254 inputs.url.val( 'http://' ); 255 inputs.title.val( '' ); 269 256 270 257 // Update save prompt. 271 258 inputs.submit.val( wpLinkL10n.save ); 272 259 }, 273 260 274 261 searchInternalLinks: function() { 275 var t = $( this), waiting,262 var t = $( this ), waiting, 276 263 search = t.val(); 277 264 278 265 if ( search.length > 2 ) { … … 284 271 return; 285 272 286 273 wpLink.lastSearch = search; 287 waiting = t.parent().find('.spinner').show();274 waiting = $( '#river-waiting' ).show(); 288 275 289 276 rivers.search.change( search ); 290 rivers.search.ajax( function(){ waiting.hide(); }); 277 rivers.search.ajax( function() { 278 waiting.hide(); 279 }); 291 280 } else { 292 281 rivers.search.hide(); 293 282 rivers.recent.show(); … … 355 344 }; 356 345 }, 357 346 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'); 347 toggleInternalLinking: function() { 348 var panel = $( '#search-panel' ), 349 // We're about to toggle visibility; it's currently the opposite. 350 visible = ! panel.is( ':visible' ), 351 win = $( window ), 352 toHeight = win.height() - 60, 353 toggle; 354 355 toggle = function() { 356 inputs.dialog.toggleClass( 'search-toggled', visible ); 357 setUserSetting( 'wplink', visible ? '1' : '0' ); 370 358 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(); 379 380 if ( diff > scroll ) { 381 widget.animate({'top': diff < top ? top - diff : scroll }, 200); 359 }; 360 361 // Toggle immediately on small screens, 362 // but still set inline styles to keep the modal responsive. 363 if ( win.width() < 782 ) { 364 toggle(); 365 } 366 367 // These values should be the same as in editor.css. 368 inputs.dialog.animate({ 369 marginTop: visible ? 0 : -170, 370 top: visible ? 30 : '50%', 371 height: visible ? toHeight : 340 372 }, 300, function() { 373 // Secretly switch from a fixed height to zero bottom, 374 // this makes the modal responisve. 375 $( this ).css({ 376 bottom: visible ? 30 : 'auto', 377 height: visible ? 'auto' : 340 378 }); 379 if ( win.width() >= 782 ) { 380 toggle(); 382 381 } 383 382 }); 384 event.preventDefault();385 383 } 386 384 }; 387 385 388 386 River = function( element, search ) { 389 387 var self = this; 390 388 this.element = element; 391 this.ul = element.children('ul'); 392 this.waiting = element.find('.river-waiting'); 389 this.ul = element.children( 'ul' ); 390 this.contentHeight = element.children( '#link-selector-height' ); 391 this.waiting = $( '#river-waiting' ); 393 392 394 393 this.change( search ); 395 394 this.refresh(); 396 395 397 element.scroll( function(){ self.maybeLoad(); }); 398 element.delegate('li', 'click', function(e){ self.select( $(this), e ); }); 396 $( '#link-selector' ).scroll( function() { 397 self.maybeLoad(); 398 }); 399 element.delegate( 'li', 'click', function( event ) { 400 self.select( $( this ), event ); 401 }); 399 402 }; 400 403 401 404 $.extend( River.prototype, { 402 405 refresh: function() { 403 406 this.deselect(); 404 this.visible = this.element.is( ':visible');407 this.visible = this.element.is( ':visible' ); 405 408 }, 406 409 show: function() { 407 410 if ( ! this.visible ) { … … 418 421 select: function( li, event ) { 419 422 var liHeight, elHeight, liTop, elTop; 420 423 421 if ( li.hasClass( 'unselectable') || li == this.selected )424 if ( li.hasClass( 'unselectable' ) || li == this.selected ) 422 425 return; 423 426 424 427 this.deselect(); 425 this.selected = li.addClass( 'selected');428 this.selected = li.addClass( 'selected' ); 426 429 // Make sure the element is visible 427 430 liHeight = li.outerHeight(); 428 431 elHeight = this.element.height(); … … 435 438 this.element.scrollTop( elTop + liTop - elHeight + liHeight ); 436 439 437 440 // Trigger the river-select event 438 this.element.trigger( 'river-select', [ li, event, this ]);441 this.element.trigger( 'river-select', [ li, event, this ] ); 439 442 }, 440 443 deselect: function() { 441 444 if ( this.selected ) 442 this.selected.removeClass( 'selected');445 this.selected.removeClass( 'selected' ); 443 446 this.selected = false; 444 447 }, 445 448 prev: function() { … … 448 451 449 452 var to; 450 453 if ( this.selected ) { 451 to = this.selected.prev( 'li');454 to = this.selected.prev( 'li' ); 452 455 if ( to.length ) 453 456 this.select( to ); 454 457 } … … 457 460 if ( ! this.visible ) 458 461 return; 459 462 460 var to = this.selected ? this.selected.next( 'li') : $('li:not(.unselectable):first', this.element);463 var to = this.selected ? this.selected.next( 'li' ) : $( 'li:not(.unselectable):first', this.element ); 461 464 if ( to.length ) 462 465 this.select( to ); 463 466 }, … … 478 481 479 482 this._search = search; 480 483 this.query = new Query( search ); 481 this.element.scrollTop( 0);484 this.element.scrollTop( 0 ); 482 485 }, 483 486 process: function( results, params ) { 484 487 var list = '', alt = true, classes = '', 485 488 firstPage = params.page == 1; 486 489 487 if ( ! results ) {490 if ( ! results ) { 488 491 if ( firstPage ) { 489 492 list += '<li class="unselectable"><span class="item-title"><em>' + 490 493 wpLinkL10n.noMatchesFound + '</em></span></li>'; … … 509 512 el = this.element, 510 513 bottom = el.scrollTop() + el.height(); 511 514 512 if ( ! this.query.ready() || bottom < this. ul.height() - wpLink.riverBottomThreshold )515 if ( ! this.query.ready() || bottom < this.contentHeight.height() - wpLink.riverBottomThreshold ) 513 516 return; 514 517 515 518 setTimeout(function() { 516 519 var newTop = el.scrollTop(), 517 520 newBottom = newTop + el.height(); 518 521 519 if ( ! self.query.ready() || newBottom < self. ul.height() - wpLink.riverBottomThreshold )522 if ( ! self.query.ready() || newBottom < self.contentHeight.height() - wpLink.riverBottomThreshold ) 520 523 return; 521 524 522 525 self.waiting.show(); 523 526 el.scrollTop( newTop + self.waiting.outerHeight() ); 524 527 525 self.ajax( function() { self.waiting.hide(); }); 528 self.ajax( function() { 529 self.waiting.hide(); 530 }); 526 531 }, wpLink.timeToTriggerRiver ); 527 532 } 528 533 }); … … 536 541 537 542 $.extend( Query.prototype, { 538 543 ready: function() { 539 return ! ( this.querying || this.allLoaded );544 return ! ( this.querying || this.allLoaded ); 540 545 }, 541 546 ajax: function( callback ) { 542 547 var self = this, … … 551 556 552 557 this.querying = true; 553 558 554 $.post( ajaxurl, query, function( r) {559 $.post( ajaxurl, query, function( r ) { 555 560 self.page++; 556 561 self.querying = false; 557 self.allLoaded = ! r;562 self.allLoaded = ! r; 558 563 callback( r, query ); 559 564 }, 'json' ); 560 565 } 561 566 }); 562 567 563 $( document).ready( wpLink.init );564 })( jQuery);568 $( document ).ready( wpLink.init ); 569 })( 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'),