WordPress.org

Make WordPress Core

Ticket #28873: 28873.5.patch

File 28873.5.patch, 8.5 KB (added by afercia, 5 years ago)
  • src/wp-admin/css/forms.css

     
    675675  19.0 - Tools
    676676------------------------------------------------------------------------------*/
    677677
    678 .tool-box .title {
    679         margin: 8px 0;
    680         font-size: 18px;
    681         font-weight: normal;
    682         line-height: 24px;
    683 }
    684 
    685678.pressthis {
    686679        margin: 20px 0;
    687680}
     
    704697        text-decoration: none;
    705698}
    706699
    707 .pressthis a:active {
    708         outline: none;
    709 }
    710 
    711 .pressthis a:hover:after {
    712         -webkit-transform: skew(20deg) rotate(9deg);
    713         -ms-transform: skew(20deg) rotate(9deg);
    714         transform: skew(20deg) rotate(9deg);
    715         -webkit-box-shadow: 0 10px 8px rgba(0, 0, 0, 0.7);
    716         box-shadow: 0 10px 8px rgba(0, 0, 0, 0.7);
    717 }
    718 
    719700.pressthis a span {
    720701        display: inline-block;
    721702        margin: 0px 0 0;
     
    748729        box-shadow: 0 10px 8px rgba(0, 0, 0, 0.6);
    749730}
    750731
     732.pressthis a:hover:after {
     733        -webkit-transform: skew(20deg) rotate(9deg);
     734        -ms-transform: skew(20deg) rotate(9deg);
     735        transform: skew(20deg) rotate(9deg);
     736        -webkit-box-shadow: 0 10px 8px rgba(0, 0, 0, 0.7);
     737        box-shadow: 0 10px 8px rgba(0, 0, 0, 0.7);
     738}
     739
     740.pressthis .separator-or {
     741        margin: 0 1em;
     742}
     743
     744#pressthis-code-wrap {
     745        /* avoid a few pixels jump on slideToggle making this a new formatting context */
     746        overflow: hidden;
     747}
     748
     749#pressthis-code {
     750        height: 100px;
     751        width: 60em;
     752        max-width: 100%;
     753        margin: 1em 0;
     754}
     755
    751756/*------------------------------------------------------------------------------
    752757  20.0 - Settings
    753758------------------------------------------------------------------------------*/
  • src/wp-admin/options-writing.php

     
    116116<h3 class="title"><?php _e('Press This') ?></h3>
    117117<p><?php _e('Press This is a bookmarklet: a little app that runs in your browser and lets you grab bits of the web.');?></p>
    118118<p><?php _e('Use Press This to clip text, images and videos from any web page. Then edit and add more straight from Press This before you save or publish it in a post on your site.'); ?></p>
    119 <p><?php _e('Drag-and-drop the following link to your bookmarks bar or right click it and add it to your favorites for a posting shortcut.') ?></p>
    120 <p class="pressthis"><a onclick="return false;" oncontextmenu="if(window.navigator.userAgent.indexOf('WebKit')!=-1||window.navigator.userAgent.indexOf('MSIE')!=-1){jQuery('.pressthis-code').show().find('textarea').focus().select();return false;}" href="<?php echo htmlspecialchars( get_shortcut_link() ); ?>"><span><?php _e('Press This') ?></span></a></p>
    121 <div class="pressthis-code" style="display:none;">
    122         <p class="description"><?php _e('If your bookmarks toolbar is hidden: copy the code below, open your Bookmarks manager, create new bookmark, type Press This into the name field and paste the code into the URL field.') ?></p>
    123         <p><textarea rows="5" cols="120" readonly="readonly"><?php echo htmlspecialchars( get_shortcut_link() ); ?></textarea></p>
     119<p class="description"><?php _e('Drag-and-drop the Press This link to your bookmarks bar or copy the link code and follow instructions for a posting shortcut.') ?></p>
     120<p class="pressthis">
     121        <a onclick="return false;" oncontextmenu="return false;" href="<?php echo htmlspecialchars( get_shortcut_link() ); ?>"><span><?php _e( 'Press This' ) ?></span></a>
     122        <span class="separator-or"><?php echo __( 'or' ); ?></span>
     123        <button type="button" class="button button-large show-pressthis-code" aria-expanded="false" aria-controls="pressthis-code-wrap"><?php _e( 'Copy Press This code' ); ?></button>
     124</p>
     125<div class="hidden" id="pressthis-code-wrap">
     126        <p class="description" id="pressthis-code-desc"><?php _e( 'Copy the selected code below, open your Bookmarks manager, create new bookmark, type Press This into the name field and paste the code into the URL field.' ) ?></p>
     127        <label for="pressthis-code" class="screen-reader-text"><?php _e( 'Press This code' ); ?></label>
     128        <textarea rows="5" cols="120" readonly="readonly" id="pressthis-code" class="pressthis-code" aria-labelledby="pressthis-code-desc"><?php echo htmlspecialchars( get_shortcut_link() ); ?></textarea>
    124129</div>
     130<script>
     131jQuery( document ).ready( function( $ ) {
     132        var $pressthisCode = $( '#pressthis-code' );
     133        $( '.show-pressthis-code' ).on( 'click', function( event ) {
     134                $( '#pressthis-code-wrap' ).slideToggle( 200 );
     135                $( this ).attr( 'aria-expanded', $( this ).attr( 'aria-expanded' ) === 'false' ? 'true' : 'false' );
     136        });
     137        // Select Press This code when focusing (tabbing) or clicking the textarea.
     138        $pressthisCode.on( 'click focus', function() {
     139                var self = this;
     140                setTimeout( function() { self.select(); }, 50 );
     141        });
     142});
     143</script>
    125144
    126145<?php
    127146/** This filter is documented in wp-admin/options.php */
  • src/wp-admin/tools.php

     
    3737
    3838<?php if ( current_user_can('edit_posts') ) : ?>
    3939<div class="tool-box">
    40         <h3 class="title"><?php _e('Press This') ?></h3>
    41         <p><?php _e('Press This is a bookmarklet: a little app that runs in your browser and lets you grab bits of the web.');?></p>
    42 
    43         <p><?php _e('Use Press This to clip text, images and videos from any web page. Then edit and add more straight from Press This before you save or publish it in a post on your site.'); ?></p>
    44         <p class="description"><?php _e('Drag-and-drop the following link to your bookmarks bar or right click it and add it to your favorites for a posting shortcut.') ?></p>
    45         <p class="pressthis"><a onclick="return false;" oncontextmenu="if(window.navigator.userAgent.indexOf('WebKit')!=-1||window.navigator.userAgent.indexOf('MSIE')!=-1){jQuery('.pressthis-code').show().find('textarea').focus().select();return false;}" href="<?php echo htmlspecialchars( get_shortcut_link() ); ?>"><span><?php _e('Press This') ?></span></a></p>
    46         <div class="pressthis-code" style="display:none;">
    47         <p class="description"><?php _e('If your bookmarks toolbar is hidden: copy the code below, open your Bookmarks manager, create new bookmark, type Press This into the name field and paste the code into the URL field.') ?></p>
    48         <p><textarea rows="5" cols="120" readonly="readonly"><?php echo htmlspecialchars( get_shortcut_link() ); ?></textarea></p>
    49         </div>
     40<h3 class="title"><?php _e('Press This') ?></h3>
     41<p><?php _e('Press This is a bookmarklet: a little app that runs in your browser and lets you grab bits of the web.');?></p>
     42<p><?php _e('Use Press This to clip text, images and videos from any web page. Then edit and add more straight from Press This before you save or publish it in a post on your site.'); ?></p>
     43<p class="description"><?php _e('Drag-and-drop the Press This link to your bookmarks bar or copy the link code and follow instructions for a posting shortcut.') ?></p>
     44<p class="pressthis">
     45        <a onclick="return false;" oncontextmenu="return false;" href="<?php echo htmlspecialchars( get_shortcut_link() ); ?>"><span><?php _e( 'Press This' ) ?></span></a>
     46        <span class="separator-or"><?php echo __( 'or' ); ?></span>
     47        <button type="button" class="button button-large show-pressthis-code" aria-expanded="false" aria-controls="pressthis-code-wrap"><?php _e( 'Copy Press This code' ); ?></button>
     48</p>
     49<div class="hidden" id="pressthis-code-wrap">
     50        <p class="description" id="pressthis-code-desc"><?php _e( 'Copy the selected code below, open your Bookmarks manager, create new bookmark, type Press This into the name field and paste the code into the URL field.' ) ?></p>
     51        <label for="pressthis-code" class="screen-reader-text"><?php _e( 'Press This code' ); ?></label>
     52        <textarea rows="5" cols="120" readonly="readonly" id="pressthis-code" class="pressthis-code" aria-labelledby="pressthis-code-desc"><?php echo htmlspecialchars( get_shortcut_link() ); ?></textarea>
    5053</div>
     54<script>
     55jQuery( document ).ready( function( $ ) {
     56        var $pressthisCode = $( '#pressthis-code' );
     57        $( '.show-pressthis-code' ).on( 'click', function( event ) {
     58                $( '#pressthis-code-wrap' ).slideToggle( 200 );
     59                $( this ).attr( 'aria-expanded', $( this ).attr( 'aria-expanded' ) === 'false' ? 'true' : 'false' );
     60        });
     61        // Select Press This code when focusing (tabbing) or clicking the textarea.
     62        $pressthisCode.on( 'click focus', function() {
     63                var self = this;
     64                setTimeout( function() { self.select(); }, 50 );
     65        });
     66});
     67</script>
     68</div>
    5169<?php
    5270endif;
    5371