| @@ -1,15 +1,6 @@ | ||
| 1 | -<?php | |
| 2 | -/** | |
| 3 | - * Toolbox template. | |
| 4 | - * | |
| 5 | - * @package Activitypub | |
| 6 | - */ | |
| 7 | - | |
| 8 | -?> | |
| 9 | - | |
| 10 | 1 | <div class="card activitypub" id="activitypub"> |
| 11 | - <h2><?php esc_html_e( 'Fediverse Bookmarklet ⁂', 'activitypub' ); ?></h2> | |
| 2 | + <h2><?php esc_html_e( '⁂ Fediverse Bookmarklet', 'activitypub' ); ?></h2> | |
| 12 | 3 | <p> |
| 13 | 4 | <?php esc_html_e( 'This lightweight bookmarklet makes it simple to reply to content on any webpage that supports ActivityPub, enhancing your interaction on the fediverse.', 'activitypub' ); ?> |
| 14 | 5 | </p> |
| 15 | 6 | <form> |
| @@ -15,10 +6,10 @@ | ||
| 15 | 6 | <form> |
| 16 | 7 | <h3><?php esc_html_e( 'Install Bookmarklet', 'activitypub' ); ?></h3> |
| 17 | 8 | <p><?php esc_html_e( 'Drag and drop this button to your browser’s bookmark bar or save this bookmarklet to reply to posts on other websites from your blog! When visiting a post on another site, click the bookmarklet to start a reply.', 'activitypub' ); ?></p> |
| 18 | 9 | <p class="activitypub-bookmarklet-wrapper"> |
| 19 | - <a class="activitypub-bookmarklet button" onclick="return false;" href="<?php echo esc_attr( \Activitypub\get_reply_intent_js() ); ?>" style="cursor: grab;"> | |
| 20 | - <?php // translators: The host (domain) of the Blog. ?> | |
| 10 | + <a class="activitypub-bookmarklet button" onclick="return false;" href="<?php echo esc_html( \Activitypub\get_reply_intent_uri() ); ?>" style="cursor: grab;"> | |
| 11 | + <?php // translators: The host (domain) of the Blog ?> | |
| 21 | 12 | <?php printf( esc_html__( 'Reply from %s', 'activitypub' ), esc_attr( \wp_parse_url( \home_url(), PHP_URL_HOST ) ) ); ?> |
| 22 | 13 | </a> |
| 23 | 14 | </p> |
| 24 | 15 | <div class="activitypub-code-wrap clear" id="activitypub-code-wrap"> |
| @@ -25,9 +16,9 @@ | ||
| 25 | 16 | <p id="activitypub-code-desc"> |
| 26 | 17 | <?php esc_html_e( 'Or copy the following code and create a new bookmark. Paste the code into the new bookmark’s URL field.', 'activitypub' ); ?> |
| 27 | 18 | </p> |
| 28 | 19 | <p> |
| 29 | - <textarea id="activitypub-bookmarklet-code" class="large-text activitypub-code" rows="5" readonly="readonly" aria-labelledby="activitypub-code-desc"><?php echo esc_textarea( \Activitypub\get_reply_intent_js() ); ?></textarea> | |
| 20 | + <textarea id="activitypub-bookmarklet-code" class="large-text activitypub-code" rows="5" readonly="readonly" aria-labelledby="activitypub-code-desc"><?php echo esc_html( \Activitypub\get_reply_intent_uri() ); ?></textarea> | |
| 30 | 21 | </p> |
| 31 | 22 | <p><span class="dashicons dashicons-clipboard"></span> <a href="javascript:;" class="copy-activitypub-bookmarklet-code" style="cursor: copy;"><?php esc_html_e( 'Copy to clipboard', 'activitypub' ); ?></a></p> |
| 32 | 23 | </div> |
| 33 | 24 | <script> |
| @@ -33,16 +24,16 @@ | ||
| 33 | 24 | <script> |
| 34 | 25 | jQuery( document ).ready( function( $ ) { |
| 35 | 26 | var $copyActivitypubBookmarkletCode = $( '.copy-activitypub-bookmarklet-code' ); |
| 36 | 27 | $copyActivitypubBookmarkletCode.on( 'click', function( event ) { |
| 37 | - // Get the text field. | |
| 28 | + // Get the text field | |
| 38 | 29 | var copyText = document.getElementById("activitypub-bookmarklet-code"); |
| 39 | 30 | |
| 40 | - // Select the text field. | |
| 31 | + // Select the text field | |
| 41 | 32 | copyText.select(); |
| 42 | - copyText.setSelectionRange(0, 99999); // For mobile devices. | |
| 33 | + copyText.setSelectionRange(0, 99999); // For mobile devices | |
| 43 | 34 | |
| 44 | - // Copy the text inside the text field. | |
| 35 | + // Copy the text inside the text field | |
| 45 | 36 | navigator.clipboard.writeText(copyText.value); |
| 46 | 37 | }); |
| 47 | 38 | }); |
| 48 | 39 | </script> |
| @@ -66,12 +57,8 @@ | ||
| 66 | 57 | <tbody> |
| 67 | 58 | <tr> |
| 68 | 59 | <td>in_reply_to</td> |
| 69 | 60 | <td><?php esc_html_e( 'The URL of the content you want to reply to.', 'activitypub' ); ?></td> |
| 70 | - </tr> | |
| 71 | - <tr> | |
| 72 | - <td>post_type</td> | |
| 73 | - <td><?php esc_html_e( 'The Post-Type you want to use for replies.', 'activitypub' ); ?></td> | |
| 74 | 61 | </tr> |
| 75 | 62 | </tbody> |
| 76 | 63 | </table> |
| 77 | 64 | <p><?php esc_html_e( 'There might be more query parameters in the future.', 'activitypub' ); ?></p> |