Plugin Directory

Changeset 3019809


Ignore:
Timestamp:
01/10/2024 11:44:02 AM (2 years ago)
Author:
janboddez
Message:

Update to version 0.17.3 from GitHub

Location:
share-on-mastodon
Files:
10 edited
1 copied

Legend:

Unmodified
Added
Removed
  • share-on-mastodon/tags/0.17.3/assets/block-editor.js

    r2961502 r3019809  
    6868        }, 6000 );
    6969
    70         try {
    71             apiFetch( {
    72                 path: url.addQueryArgs( '/share-on-mastodon/v1/url', { post_id: postId } ),
    73                 signal: controller.signal, // That time-out thingy.
    74             } ).then( function( response ) {
    75                 clearTimeout( timeoutId );
    76 
    77                 if ( response.hasOwnProperty( 'url' ) && isValidUrl( response.url ) ) {
    78                     setMastoUrl( response.url );
    79                 }
    80 
    81                 setError( response.error ?? '' );
    82             } ).catch( function( error ) {
    83                 // The request timed out or otherwise failed. Leave as is.
    84                 throw new Error( 'The "Get URL" request failed.' )
    85             } );
    86         } catch ( error ) {
    87             return false;
    88         }
    89 
    90         // All good.
    91         return true;
     70        apiFetch( {
     71            path: url.addQueryArgs( '/share-on-mastodon/v1/url', { post_id: postId } ),
     72            signal: controller.signal, // That time-out thingy.
     73        } ).then( function( response ) {
     74            clearTimeout( timeoutId );
     75
     76            if ( response.hasOwnProperty( 'url' ) && isValidUrl( response.url ) ) {
     77                setMastoUrl( response.url );
     78            }
     79
     80            setError( response.error ?? '' );
     81        } ).catch( function( error ) {
     82            // The request timed out or otherwise failed. Leave as is.
     83            console.debug( '[Share on Mastodon] "Get URL" request failed.' );
     84        } );
    9285    };
    9386
  • share-on-mastodon/tags/0.17.3/includes/class-options-handler.php

    r2993570 r3019809  
    461461                        <tr valign="top">
    462462                            <th scope="row"><label for="share_on_mastodon_settings[max_images]"><?php esc_html_e( 'Max. No. of Images', 'share-on-mastodon' ); ?></label></th>
    463                             <td><input type="number" min="0" max="4" style="width: 6em;" id="share_on_mastodon_settings[max_images]" name="share_on_mastodon_settings[max_images]" value="<?php echo esc_attr( ! empty( $this->options['max_images'] ) ? $this->options['max_images'] : '4' ); ?>" />
     463                            <td><input type="number" min="0" max="4" style="width: 6em;" id="share_on_mastodon_settings[max_images]" name="share_on_mastodon_settings[max_images]" value="<?php echo esc_attr( isset( $this->options['max_images'] ) ? $this->options['max_images'] : '4' ); ?>" />
    464464                            <p class="description"><?php esc_html_e( 'The maximum number of images that will be uploaded. (Mastodon supports up to 4 images.)', 'share-on-mastodon' ); ?></p></td>
    465465                        </tr>
     
    783783        }
    784784
    785         $this->options = array_combine( array_keys( self::SCHEMA ), array_column( self::SCHEMA, 'default' ) );
     785        $this->options = static::get_default_options();
    786786
    787787        update_option( 'share_on_mastodon_settings', $this->options );
  • share-on-mastodon/tags/0.17.3/includes/class-share-on-mastodon.php

    r2993570 r3019809  
    1212 */
    1313class Share_On_Mastodon {
    14     const PLUGIN_VERSION = '0.17.2';
     14    const PLUGIN_VERSION = '0.17.3';
    1515
    1616    /**
  • share-on-mastodon/tags/0.17.3/readme.txt

    r2993570 r3019809  
    33Tags: mastodon, share, publicize, crosspost, fediverse, syndication, posse
    44Tested up to: 6.4
    5 Stable tag: 0.17.2
     5Stable tag: 0.17.3
    66License: GNU General Public License v3.0
    77License URI: https://www.gnu.org/licenses/gpl-3.0.html
     
    2929
    3030== Changelog ==
     31= 0.17.3 =
     32Fix max images option.
     33
    3134= 0.17.2 =
    3235Fix permalinks with emoji in them. Somewhat smarter `%excerpt%` lengths.
  • share-on-mastodon/tags/0.17.3/share-on-mastodon.php

    r2993570 r3019809  
    99 * License URI:       http://www.gnu.org/licenses/gpl-3.0.html
    1010 * Text Domain:       share-on-mastodon
    11  * Version:           0.17.2
     11 * Version:           0.17.3
    1212 * Requires at least: 5.9
    1313 *
  • share-on-mastodon/trunk/assets/block-editor.js

    r2961502 r3019809  
    6868        }, 6000 );
    6969
    70         try {
    71             apiFetch( {
    72                 path: url.addQueryArgs( '/share-on-mastodon/v1/url', { post_id: postId } ),
    73                 signal: controller.signal, // That time-out thingy.
    74             } ).then( function( response ) {
    75                 clearTimeout( timeoutId );
    76 
    77                 if ( response.hasOwnProperty( 'url' ) && isValidUrl( response.url ) ) {
    78                     setMastoUrl( response.url );
    79                 }
    80 
    81                 setError( response.error ?? '' );
    82             } ).catch( function( error ) {
    83                 // The request timed out or otherwise failed. Leave as is.
    84                 throw new Error( 'The "Get URL" request failed.' )
    85             } );
    86         } catch ( error ) {
    87             return false;
    88         }
    89 
    90         // All good.
    91         return true;
     70        apiFetch( {
     71            path: url.addQueryArgs( '/share-on-mastodon/v1/url', { post_id: postId } ),
     72            signal: controller.signal, // That time-out thingy.
     73        } ).then( function( response ) {
     74            clearTimeout( timeoutId );
     75
     76            if ( response.hasOwnProperty( 'url' ) && isValidUrl( response.url ) ) {
     77                setMastoUrl( response.url );
     78            }
     79
     80            setError( response.error ?? '' );
     81        } ).catch( function( error ) {
     82            // The request timed out or otherwise failed. Leave as is.
     83            console.debug( '[Share on Mastodon] "Get URL" request failed.' );
     84        } );
    9285    };
    9386
  • share-on-mastodon/trunk/includes/class-options-handler.php

    r2993570 r3019809  
    461461                        <tr valign="top">
    462462                            <th scope="row"><label for="share_on_mastodon_settings[max_images]"><?php esc_html_e( 'Max. No. of Images', 'share-on-mastodon' ); ?></label></th>
    463                             <td><input type="number" min="0" max="4" style="width: 6em;" id="share_on_mastodon_settings[max_images]" name="share_on_mastodon_settings[max_images]" value="<?php echo esc_attr( ! empty( $this->options['max_images'] ) ? $this->options['max_images'] : '4' ); ?>" />
     463                            <td><input type="number" min="0" max="4" style="width: 6em;" id="share_on_mastodon_settings[max_images]" name="share_on_mastodon_settings[max_images]" value="<?php echo esc_attr( isset( $this->options['max_images'] ) ? $this->options['max_images'] : '4' ); ?>" />
    464464                            <p class="description"><?php esc_html_e( 'The maximum number of images that will be uploaded. (Mastodon supports up to 4 images.)', 'share-on-mastodon' ); ?></p></td>
    465465                        </tr>
     
    783783        }
    784784
    785         $this->options = array_combine( array_keys( self::SCHEMA ), array_column( self::SCHEMA, 'default' ) );
     785        $this->options = static::get_default_options();
    786786
    787787        update_option( 'share_on_mastodon_settings', $this->options );
  • share-on-mastodon/trunk/includes/class-share-on-mastodon.php

    r2993570 r3019809  
    1212 */
    1313class Share_On_Mastodon {
    14     const PLUGIN_VERSION = '0.17.2';
     14    const PLUGIN_VERSION = '0.17.3';
    1515
    1616    /**
  • share-on-mastodon/trunk/readme.txt

    r2993570 r3019809  
    33Tags: mastodon, share, publicize, crosspost, fediverse, syndication, posse
    44Tested up to: 6.4
    5 Stable tag: 0.17.2
     5Stable tag: 0.17.3
    66License: GNU General Public License v3.0
    77License URI: https://www.gnu.org/licenses/gpl-3.0.html
     
    2929
    3030== Changelog ==
     31= 0.17.3 =
     32Fix max images option.
     33
    3134= 0.17.2 =
    3235Fix permalinks with emoji in them. Somewhat smarter `%excerpt%` lengths.
  • share-on-mastodon/trunk/share-on-mastodon.php

    r2993570 r3019809  
    99 * License URI:       http://www.gnu.org/licenses/gpl-3.0.html
    1010 * Text Domain:       share-on-mastodon
    11  * Version:           0.17.2
     11 * Version:           0.17.3
    1212 * Requires at least: 5.9
    1313 *
Note: See TracChangeset for help on using the changeset viewer.