Make WordPress Core

Ticket #26952: 26952.7.patch

File 26952.7.patch, 40.3 KB (added by iseulde, 11 years ago)
  • src/wp-includes/class-wp-editor.php

     
    241241                                                'wpeditimage',
    242242                                                'wpgallery',
    243243                                                'wplink',
    244                                                 'wpdialogs',
    245244                                                'wpview',
    246245                                        ) ) );
    247246
     
    492491
    493492                if ( in_array('wplink', self::$plugins, true) || in_array('link', self::$qt_buttons, true) ) {
    494493                        wp_enqueue_script('wplink');
    495                         wp_enqueue_script('wpdialogs');
    496                         wp_enqueue_style('wp-jquery-ui-dialog');
    497494                }
    498495
    499496                if ( in_array('wpfullscreen', self::$plugins, true) || in_array('fullscreen', self::$qt_buttons, true) )
     
    10411038         * @since 3.1.0
    10421039         */
    10431040        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>
    10701049                        </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>
    10751081                                </div>
    10761082                        </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">
    10831085                        </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
    10971088        }
    10981089}
  • src/wp-includes/css/buttons.css

     
    11/* ----------------------------------------------------------------------------
    22
     3NOTE: If you edit this file, you should make sure that the CSS rules for
     4buttons in the following files are updated.
     5
     6* jquery-ui-dialog.css
     7* editor.css
    38
    49WordPress-style Buttons
    510=======================
  • src/wp-includes/css/editor.css

     
    308308}
    309309
    310310/* Buttons in modals */
    311 .mce-primary button,
    312 .mce-primary button i {
     311.mce-btn button,
     312.mce-btn button i {
    313313        text-align: center;
    314314        color: #fff;
    315315        text-shadow: none;
     316        padding: 0;
     317        line-height: 26px;
    316318}
    317319
    318320.mce-window .mce-btn {
    319         color: #555;
    320         background: #f7f7f7;
     321        display: inline-block;
    321322        text-decoration: none;
    322323        font-size: 13px;
    323324        line-height: 26px;
    324         height: 28px;
     325        height: 28px!important;
    325326        margin: 0;
    326         padding: 0;
     327        padding: 0 10px 1px;
    327328        cursor: pointer;
    328         border: 1px solid #ccc;
     329        border-width: 1px;
     330        border-style: solid;
    329331        -webkit-appearance: none;
    330332        -webkit-border-radius: 3px;
    331333        border-radius: 3px;
    332334        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;
    333341        -webkit-box-shadow: inset 0 1px 0 #fff, 0 1px 0 rgba(0,0,0,.08);
    334342        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;
    336352}
    337353
    338354.mce-window .mce-btn:hover {
     
    352368        color: #333;
    353369        -webkit-box-shadow: inset 0 2px 5px -3px rgba( 0, 0, 0, 0.5 );
    354370        box-shadow: inset 0 2px 5px -3px rgba( 0, 0, 0, 0.5 );
     371        outline: none;
    355372}
    356373
     374.mce-window .mce-btn[disabled],
     375.mce-window .mce-btn:disabled,
    357376.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;
    363383        cursor: default;
    364384}
    365385
    366386.mce-window .mce-btn.mce-primary {
    367387        background: #2ea2cc;
    368388        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;
    372393}
    373394
    374 .mce-window .mce-btn.mce-primary:hover {
     395.mce-window .mce-btn.mce-primary:hover,
     396.mce-window .mce-btn.mce-primary:focus {
    375397        background: #1e8cbe;
    376398        border-color: #0074a2;
    377         -webkit-box-shadow: inset 0 1px 0 rgba(120,200,230,0.6);
    378         box-shadow: inset 0 1px 0 rgba(120,200,230,0.6);
     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);
    379401        color: #fff;
    380402}
    381403
     
    389411        background: #1b7aa6;
    390412        border-color: #005684;
    391413        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;
    394417}
    395418
     419.mce-window .mce-btn.mce-primary[disabled],
     420.mce-window .mce-btn.mce-primary:disabled,
    396421.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
    401442}
    402443
    403444/* Charmap modal */
     
    860901        background-color: #ccc;
    861902}
    862903
    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;
    878916}
    879917
    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;
    884931}
    885932
    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;
    895938}
    896939
    897 #wp-link #link-options {
    898         padding: 10px 0 14px;
     940#link-modal-title {
     941        background: #fcfcfc;
    899942        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;
    901952}
    902953
    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;
    905964}
    906965
    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';
    911976}
    912977
    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;
    917980}
    918981
    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;
    921990}
    922991
    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;
    926997}
    927998
    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;
    9341003}
    9351004
    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%;
    9391009}
    9401010
    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;
    9451016}
    9461017
    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;
    9501021}
    9511022
    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';
    9551030}
    9561031
    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';
    9621034}
    9631035
    9641036#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;
    9711038}
    9721039
    9731040#wp-link li,
     
    9771044        border-bottom: 1px solid #f1f1f1;
    9781045        color: #333;
    9791046        padding: 4px 6px;
    980         cursor: pointer;
    9811047        position: relative;
    9821048}
    9831049
    984 #wp-link li:hover {
    985         background: #eaf2fa;
    986         color: #151515;
     1050#wp-link li {
     1051        cursor: pointer;
    9871052}
    9881053
    9891054#wp-link li.unselectable {
    990         border-bottom: 1px solid #dfdfdf;
     1055        cursor: default;
    9911056}
    9921057
    993 #wp-link li.unselectable:hover {
    994         background: #fff;
    995         cursor: auto;
    996         color: #333;
     1058#wp-link li:hover {
     1059        background: #eaf2fa;
    9971060}
    9981061
    9991062#wp-link li.selected {
    1000         background: #ddd;
    1001         color: #333;
     1063        background: #f1f1f1;
    10021064}
    10031065
    10041066#wp-link li.selected .item-title {
    10051067        font-weight: bold;
    10061068}
    10071069
     1070#wp-link li:last-of-type {
     1071        border: none;
     1072}
     1073
    10081074#wp-link .item-title {
    10091075        display: inline-block;
    10101076        width: 80%;
     
    10201086        bottom: 0;
    10211087}
    10221088
    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;
    10391091        display: block;
     1092        float: none;
    10401093}
    10411094
    10421095#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;
    11121099        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;
    11481102        left: 0;
    1149         width: 100%;
    1150         height: 100%;
    11511103}
    11521104
    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 {
    12871106        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;
    13551108}
    13561109
    1357 .wp-dialog .ui-dialog-titlebar-close .ui-button-text {
    1358         display: none;
    1359 }
     1110@media screen and ( max-width: 782px ) {
    13601111
    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        }
    13651126
    1366 .ui-widget-overlay {
    1367         z-index: 300001;
    1368         background-color: #000;
    1369         opacity: 0.6;
    1370         filter: alpha(opacity=60);
    13711127}
    13721128
    13731129/* TinyMCE modal */
     
    18071563        font-family: Arial, sans-serif;
    18081564}
    18091565
    1810 
    18111566/* HiDPI */
    18121567@media print,
    18131568  (-o-min-device-pixel-ratio: 5/4),
     
    18171572        #wp-fullscreen-buttons #wp_fs_image span.mce_image {
    18181573                background: none;
    18191574        }
    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         }
    18261575}
    18271576
    18281577/* TODO: DFW responsive */
    1829 
    1830 
  • src/wp-includes/css/jquery-ui-dialog.css

     
    5656        filter:Alpha(Opacity=0);
    5757}
    5858
    59 .ui-front {
    60         z-index: 100;
    61 }
    62 
    63 
    6459/* Interaction Cues
    6560----------------------------------*/
    6661.ui-state-disabled {
    6762        cursor: default !important;
    6863}
    6964
    70 
    7165/* Icons
    7266----------------------------------*/
    7367
     
    7973        background-repeat: no-repeat;
    8074}
    8175
    82 
    83 /* Misc visuals
    84 ----------------------------------*/
    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 
    9676/*!
    9777 * jQuery UI Resizable 1.10.1
    9878 * http://jqueryui.com
     
    148128/* @noflip */
    149129.ui-resizable-se {
    150130        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;
    155135}
    156136/* @noflip */
    157137.ui-resizable-sw {
     
    178158        top: -5px;
    179159}
    180160
    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;
    206177        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;
    236195}
    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;
    240201}
    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);
    247206}
    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;
    250215}
    251216
    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;
    260226}
    261227
    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
    266239}
    267240
    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;
    274249}
    275250
    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;
    278259}
    279260
    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 {
    288262        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;
    289276}
    290277
    291 .wp-dialog .ui-dialog-titlebar-close:before {
    292         content: '\f158';
     278.ui-dialog-titlebar-close:before {
    293279        font: normal 20px/1 'dashicons';
     280        vertical-align: top;
    294281        speak: none;
    295282        -webkit-font-smoothing: antialiased;
    296283        -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';
    299288}
    300289
    301 .wp-dialog .ui-dialog-titlebar-close:hover:before {
     290.ui-button.ui-dialog-titlebar-close:hover {
    302291        color: #2ea2cc;
    303292}
    304293
    305 .wp-dialog .ui-dialog-titlebar-close .ui-button-text {
     294.ui-dialog-titlebar-close .ui-button-text {
    306295        display: none;
    307296}
    308297
    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;
    312319}
    313320
    314321.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;
    315330        z-index: 100101;
    316         background-color: #000;
    317         opacity: 0.6;
    318         filter: alpha(opacity=60);
    319331}
  • src/wp-includes/js/wplink.js

     
    11/* global ajaxurl, tinymce, wpLinkL10n, setUserSetting, wpActiveEditor */
    22var wpLink;
    33
    4 (function($){
     4( function( $ ) {
    55        var inputs = {}, rivers = {}, ed, River, Query;
    66
    77        wpLink = {
     
    1212                lastSearch: '',
    1313                textarea: '',
    1414
    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' );
    1820                        // URL
    19                         inputs.url = $('#url-field');
    20                         inputs.nonce = $('#_ajax_linking_nonce');
     21                        inputs.url = $( '#url-field' );
     22                        inputs.nonce = $( '#_ajax_linking_nonce' );
    2123                        // Secondary options
    22                         inputs.title = $('#link-title-field');
     24                        inputs.title = $( '#link-title-field' );
    2325                        // Advanced Options
    24                         inputs.openInNewTab = $('#link-target-checkbox');
    25                         inputs.search = $('#search-field');
     26                        inputs.openInNewTab = $( '#link-target-checkbox' );
     27                        inputs.search = $( '#search-field' );
    2628                        // 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 );
    3032
    3133                        // Bind event handlers
    3234                        inputs.dialog.keydown( wpLink.keydown );
    3335                        inputs.dialog.keyup( wpLink.keyup );
    34                         inputs.submit.click( function(e){
    35                                 e.preventDefault();
     36                        inputs.submit.click( function( event ) {
     37                                event.preventDefault();
    3638                                wpLink.update();
    3739                        });
    38                         $('#wp-link-cancel').click( function(e){
    39                                 e.preventDefault();
     40                        inputs.close.add( inputs.backdrop ).click( function( event ) {
     41                                event.preventDefault();
    4042                                wpLink.close();
    4143                        });
    42                         $('#internal-toggle').click( wpLink.toggleInternalLinking );
    4344
    44                         rivers.elements.bind('river-select', wpLink.updateFields );
     45                        $( '#wp-link-search-toggle' ).click( wpLink.toggleInternalLinking );
    4546
    46                         inputs.search.keyup( wpLink.searchInternalLinks );
     47                        rivers.elements.on( 'river-select', wpLink.updateFields );
    4748
    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 );
    5150                },
    5251
    53                 beforeOpen : function() {
     52                open: function( editorId ) {
    5453                        wpLink.range = null;
    5554
    5655                        if ( ! wpLink.isMCE() && document.selection ) {
    5756                                wpLink.textarea.focus();
    5857                                wpLink.range = document.selection.createRange();
    5958                        }
    60                 },
    6159
    62                 open : function( editorId ) {
    6360                        if ( editorId ) {
    6461                                window.wpActiveEditor = editorId;
    6562                        }
     
    6865                                return;
    6966                        }
    7067
    71                         this.textarea = $( '#' + wpActiveEditor ).get(0);
     68                        this.textarea = $( '#' + wpActiveEditor ).get( 0 );
    7269
    7370                        if ( typeof tinymce !== 'undefined' ) {
    7471                                ed = tinymce.get( wpActiveEditor );
     
    7875                                }
    7976                        }
    8077
    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();
    9382                },
    9483
    95                 isMCE : function() {
     84                isMCE: function() {
    9685                        return ed && ! ed.isHidden();
    9786                },
    9887
    99                 refresh : function() {
     88                refresh: function() {
    10089                        // Refresh rivers (clear links, check visibility)
    10190                        rivers.search.refresh();
    10291                        rivers.recent.refresh();
     
    135124                },
    136125
    137126                close: function() {
    138                         inputs.dialog.wpdialog('close');
    139                 },
    140 
    141                 onClose: function() {
    142127                        if ( ! wpLink.isMCE() ) {
    143128                                wpLink.textarea.focus();
    144129
     
    147132                                        wpLink.range.select();
    148133                                }
    149134                        }
     135                        inputs.dialog.fadeOut();
     136                        inputs.backdrop.fadeOut();
    150137                },
    151138
    152139                getAttrs: function() {
    153140                        return {
    154                                 href : inputs.url.val(),
    155                                 title : inputs.title.val(),
    156                                 target : inputs.openInNewTab.prop('checked') ? '_blank' : ''
     141                                href: inputs.url.val(),
     142                                title: inputs.title.val(),
     143                                target: inputs.openInNewTab.prop( 'checked' ) ? '_blank' : ''
    157144                        };
    158145                },
    159146
     
    240227
    241228                        // If the values are empty, unlink and return
    242229                        if ( ! attrs.href || attrs.href == 'http://' ) {
    243                                 ed.execCommand('unlink');
     230                                ed.execCommand( 'unlink' );
    244231                                return;
    245232                        }
    246233
     
    255242                },
    256243
    257244                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() );
    260247                        if ( originalEvent && originalEvent.type == 'click' )
    261248                                inputs.url.focus();
    262249                },
     
    264251                setDefaultValues: function() {
    265252                        // Set URL and description to defaults.
    266253                        // 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( '' );
    269256
    270257                        // Update save prompt.
    271258                        inputs.submit.val( wpLinkL10n.save );
    272259                },
    273260
    274261                searchInternalLinks: function() {
    275                         var t = $(this), waiting,
     262                        var t = $( this ), waiting,
    276263                                search = t.val();
    277264
    278265                        if ( search.length > 2 ) {
     
    284271                                        return;
    285272
    286273                                wpLink.lastSearch = search;
    287                                 waiting = t.parent().find('.spinner').show();
     274                                waiting = $( '#river-waiting' ).show();
    288275
    289276                                rivers.search.change( search );
    290                                 rivers.search.ajax( function(){ waiting.hide(); });
     277                                rivers.search.ajax( function() {
     278                                        waiting.hide();
     279                                });
    291280                        } else {
    292281                                rivers.search.hide();
    293282                                rivers.recent.show();
     
    355344                        };
    356345                },
    357346
    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' );
    370358                                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();
    382381                                }
    383382                        });
    384                         event.preventDefault();
    385383                }
    386384        };
    387385
    388386        River = function( element, search ) {
    389387                var self = this;
    390388                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' );
    393392
    394393                this.change( search );
    395394                this.refresh();
    396395
    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                });
    399402        };
    400403
    401404        $.extend( River.prototype, {
    402405                refresh: function() {
    403406                        this.deselect();
    404                         this.visible = this.element.is(':visible');
     407                        this.visible = this.element.is( ':visible' );
    405408                },
    406409                show: function() {
    407410                        if ( ! this.visible ) {
     
    418421                select: function( li, event ) {
    419422                        var liHeight, elHeight, liTop, elTop;
    420423
    421                         if ( li.hasClass('unselectable') || li == this.selected )
     424                        if ( li.hasClass( 'unselectable' ) || li == this.selected )
    422425                                return;
    423426
    424427                        this.deselect();
    425                         this.selected = li.addClass('selected');
     428                        this.selected = li.addClass( 'selected' );
    426429                        // Make sure the element is visible
    427430                        liHeight = li.outerHeight();
    428431                        elHeight = this.element.height();
     
    435438                                this.element.scrollTop( elTop + liTop - elHeight + liHeight );
    436439
    437440                        // Trigger the river-select event
    438                         this.element.trigger('river-select', [ li, event, this ]);
     441                        this.element.trigger( 'river-select', [ li, event, this ] );
    439442                },
    440443                deselect: function() {
    441444                        if ( this.selected )
    442                                 this.selected.removeClass('selected');
     445                                this.selected.removeClass( 'selected' );
    443446                        this.selected = false;
    444447                },
    445448                prev: function() {
     
    448451
    449452                        var to;
    450453                        if ( this.selected ) {
    451                                 to = this.selected.prev('li');
     454                                to = this.selected.prev( 'li' );
    452455                                if ( to.length )
    453456                                        this.select( to );
    454457                        }
     
    457460                        if ( ! this.visible )
    458461                                return;
    459462
    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 );
    461464                        if ( to.length )
    462465                                this.select( to );
    463466                },
     
    478481
    479482                        this._search = search;
    480483                        this.query = new Query( search );
    481                         this.element.scrollTop(0);
     484                        this.element.scrollTop( 0 );
    482485                },
    483486                process: function( results, params ) {
    484487                        var list = '', alt = true, classes = '',
    485488                                firstPage = params.page == 1;
    486489
    487                         if ( !results ) {
     490                        if ( ! results ) {
    488491                                if ( firstPage ) {
    489492                                        list += '<li class="unselectable"><span class="item-title"><em>' +
    490493                                                wpLinkL10n.noMatchesFound + '</em></span></li>';
     
    509512                                el = this.element,
    510513                                bottom = el.scrollTop() + el.height();
    511514
    512                         if ( ! this.query.ready() || bottom < this.ul.height() - wpLink.riverBottomThreshold )
     515                        if ( ! this.query.ready() || bottom < this.contentHeight.height() - wpLink.riverBottomThreshold )
    513516                                return;
    514517
    515518                        setTimeout(function() {
    516519                                var newTop = el.scrollTop(),
    517520                                        newBottom = newTop + el.height();
    518521
    519                                 if ( ! self.query.ready() || newBottom < self.ul.height() - wpLink.riverBottomThreshold )
     522                                if ( ! self.query.ready() || newBottom < self.contentHeight.height() - wpLink.riverBottomThreshold )
    520523                                        return;
    521524
    522525                                self.waiting.show();
    523526                                el.scrollTop( newTop + self.waiting.outerHeight() );
    524527
    525                                 self.ajax( function() { self.waiting.hide(); });
     528                                self.ajax( function() {
     529                                        self.waiting.hide();
     530                                });
    526531                        }, wpLink.timeToTriggerRiver );
    527532                }
    528533        });
     
    536541
    537542        $.extend( Query.prototype, {
    538543                ready: function() {
    539                         return !( this.querying || this.allLoaded );
     544                        return ! ( this.querying || this.allLoaded );
    540545                },
    541546                ajax: function( callback ) {
    542547                        var self = this,
     
    551556
    552557                        this.querying = true;
    553558
    554                         $.post( ajaxurl, query, function(r) {
     559                        $.post( ajaxurl, query, function( r ) {
    555560                                self.page++;
    556561                                self.querying = false;
    557                                 self.allLoaded = !r;
     562                                self.allLoaded = ! r;
    558563                                callback( r, query );
    559564                        }, 'json' );
    560565                }
    561566        });
    562567
    563         $(document).ready( wpLink.init );
    564 })(jQuery);
     568        $( document ).ready( wpLink.init );
     569})( jQuery );
  • src/wp-includes/script-loader.php

     
    338338
    339339        $scripts->add( 'admin-bar', "/wp-includes/js/admin-bar$suffix.js", array(), false, 1 );
    340340
    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 );
    342342        did_action( 'init' ) && $scripts->localize( 'wplink', 'wpLinkL10n', array(
    343343                'title' => __('Insert/edit link'),
    344344                'update' => __('Update'),