WordPress.org

Make WordPress Core

Ticket #28873: 28873.3.patch

File 28873.3.patch, 3.4 KB (added by azaozz, 5 years ago)
  • src/wp-admin/css/forms.css

     
    748748        box-shadow: 0 10px 8px rgba(0, 0, 0, 0.6);
    749749}
    750750
     751.pressthis button.show-pressthis-code {
     752        margin-left: 2em;
     753}
     754
     755.pressthis-code-wrap textarea.pressthis-code {
     756        height: 100px;
     757        width: 60em;
     758        max-width: 100%;
     759}
     760
    751761/*------------------------------------------------------------------------------
    752762  20.0 - Settings
    753763------------------------------------------------------------------------------*/
  • src/wp-admin/tools.php

     
    4141        <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>
    4242
    4343        <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>
     44        <p class="description"><?php _e( 'Drag-and-drop the following link to your bookmarks bar or copy the link code and follow instructions for a posting shortcut.' ) ?></p>
     45        <p class="pressthis">
     46                <a onclick="return false;" oncontextmenu="return false;" href="<?php echo htmlspecialchars( get_shortcut_link() ); ?>"><span><?php _e( 'Press This link' ) ?></span></a>
     47                <button type="button" class="button button-large show-pressthis-code"><?php _e( 'Copy Press This Code' ); ?></button>
     48        </p>
     49        <div class="pressthis-code-wrap hidden">
     50        <p class="description"><?php _e( '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>
     51        <p><textarea rows="5" cols="120" readonly="readonly" class="pressthis-code"><?php echo htmlspecialchars( get_shortcut_link() ); ?></textarea></p>
    4952        </div>
     53        <script>
     54        jQuery( document ).ready( function( $ ) {
     55                var $pressthisCode = $( '.pressthis-code' );
     56
     57                $( 'button.show-pressthis-code' ).on( 'click', function( event ) {
     58                        $( '.pressthis-code-wrap' ).slideToggle( 200 );
     59                        $pressthisCode.focus();
     60                });
     61                // Select code even when tabbing inside already open textarea.
     62                $pressthisCode.on( 'focus', function() {
     63                        var self = this;
     64                        setTimeout( function() { self.select(); }, 50 );
     65                });
     66        });
     67        </script>
    5068</div>
    5169<?php
    5270endif;