0.110 various fixes

This commit is contained in:
Django Doucet 2020-10-27 23:24:25 -04:00
parent ca8be5e49a
commit eb8965e25b
8 changed files with 31 additions and 17 deletions

View File

@ -86,8 +86,9 @@
} }
.account__header__tabs__buttons .button { .account__header__tabs__buttons .button {
margin: 0 8px; margin: 0 8px;
color: #fff; border: 1px solid;
border-radius: 4px; border-radius: 4px;
color: #fff;
padding: 0px 16px; padding: 0px 16px;
height: 36px; height: 36px;
line-height: 36px; line-height: 36px;

View File

@ -76,7 +76,7 @@ class FediClient
$response = $this->_get('/api/v1/accounts/verify_credentials', null, $headers); $response = $this->_get('/api/v1/accounts/verify_credentials', null, $headers);
if(property_exists($response, 'id')){ if(isset($response->id)){
$this->setStatic($response->id); $this->setStatic($response->id);
} }

View File

@ -38,7 +38,7 @@ class FediEmbedi_PeerTube extends WP_Widget {
//widget options //widget options
$show_header = (!empty($instance['show_header'])) ? $instance['show_header'] : null; $show_header = (!empty($instance['show_header'])) ? $instance['show_header'] : null;
$count = isset( $instance['number'] ) ? absint( $instance['number'] ) : 5; $count = isset( $instance['number'] ) ? absint( $instance['number'] ) : 5;
$nsfw = isset( $instance['nsfw'] ) ? $instance['nsfw'] : false; $nsfw = isset( $instance['nsfw'] ) ? $instance['nsfw'] : null;
$height = isset( $instance['height'] ) ? esc_attr( $instance['height'] ) : '100%'; $height = isset( $instance['height'] ) ? esc_attr( $instance['height'] ) : '100%';
echo $args['before_widget']; echo $args['before_widget'];
@ -48,6 +48,7 @@ class FediEmbedi_PeerTube extends WP_Widget {
//getVideos from remote instance //getVideos from remote instance
$status = $client->getVideos($actor, $is_channel, $count, $nsfw); $status = $client->getVideos($actor, $is_channel, $count, $nsfw);
if(WP_DEBUG_DISPLAY === true): echo '<details><summary>PeerTube</summary><pre>'; var_dump($status); echo '</pre></details>'; endif;
if(!is_null($is_channel)){ if(!is_null($is_channel)){
$account = $status->data[0]->channel; $account = $status->data[0]->channel;
} else { } else {
@ -103,22 +104,22 @@ class FediEmbedi_PeerTube extends WP_Widget {
<label> <label>
<input <input
type="checkbox" type="checkbox"
<?php checked( $instance[ 'show_header' ], '1' ); ?> <?php checked( $instance[ 'channel' ], '1' ); ?>
id="<?php echo $this->get_field_id( 'show_header' ); ?>" id="<?php echo $this->get_field_id( 'channel' ); ?>"
name="<?php echo $this->get_field_name('show_header'); ?>" name="<?php echo $this->get_field_name('channel'); ?>"
value="1" value="1"
/><?php _e( 'Show header', 'fediembedi' ); ?> /><?php _e( 'This account is a Channel (not a user)', 'fediembedi' ); ?>
</label> </label>
</p> </p>
<p> <p>
<label> <label>
<input <input
type="checkbox" type="checkbox"
<?php checked( $instance[ 'channel' ], '1' ); ?> <?php checked( $instance[ 'show_header' ], '1' ); ?>
id="<?php echo $this->get_field_id( 'channel' ); ?>" id="<?php echo $this->get_field_id( 'show_header' ); ?>"
name="<?php echo $this->get_field_name('channel'); ?>" name="<?php echo $this->get_field_name('show_header'); ?>"
value="1" value="1"
/><?php _e( 'Is this account a Channel?', 'fediembedi' ); ?> /><?php _e( 'Show header', 'fediembedi' ); ?>
</label> </label>
</p> </p>
<p> <p>

View File

@ -2,15 +2,15 @@
/** /**
* Plugin Name: FediEmbedi * Plugin Name: FediEmbedi
* Plugin URI: https://git.feneas.org/mediaformat/fediembedi * Plugin URI: https://git.feneas.org/mediaformat/fediembedi
* GitLab Plugin URI: https://git.feneas.org/mediaformat/fediembedi
* Description: Widgets and shortcodes to show your Fediverse profile timeline * Description: Widgets and shortcodes to show your Fediverse profile timeline
* Version: 0.10.7 * Version: 0.11.0
* Author: mediaformat * Author: mediaformat
* Author URI: https://mediaformat.org * Author URI: https://mediaformat.org
* License: GPLv3 * License: GPLv3
* License URI: https://www.gnu.org/licenses/gpl-3.0.en.html * License URI: https://www.gnu.org/licenses/gpl-3.0.en.html
* Text Domain: fediembedi * Text Domain: fediembedi
* Domain Path: /languages * Domain Path: /languages
* Github Plugin URI: https://github.com/mediaformat/fediembedi
*/ */
namespace FediEmbedi; namespace FediEmbedi;
require_once 'fediembedi-client.php'; require_once 'fediembedi-client.php';

View File

@ -53,6 +53,12 @@ and redirected to your site with a secure token. Similar to how you would connec
## Changelog ## Changelog
### 0.11.0
* Feature: PeerTube widget NSFW option.
* Fix: PeerTube number of posts to display.
* Fix: connection issues.
* Fix: Template issues.
### 0.10.5 ### 0.10.5
* Bug fix: Template issues. * Bug fix: Template issues.

View File

@ -64,6 +64,12 @@ and redirected to your site with a secure token. Similar to how you would connec
== Changelog == == Changelog ==
= 0.11.0 =
* Feature: PeerTube widget NSFW option.
* Fix: PeerTube number of posts to display.
* Fix: connection issues.
* Fix: Template issues.
= 0.10.5 = = 0.10.5 =
* Bug fix: Template issues. * Bug fix: Template issues.

View File

@ -96,11 +96,11 @@
if(!empty($statut->media_attachments)): if(!empty($statut->media_attachments)):
foreach ($statut->media_attachments as $attachment) { foreach ($statut->media_attachments as $attachment) {
if (!empty($attachment->preview_url) && $attachment->type === 'image'): ?> if (!empty($attachment->preview_url) && $attachment->type === 'image'): ?>
<img src="<?php echo $attachment->preview_url; ?>" class="media-gallery__item" alt="<?php echo $attachment->description; ?>" loading="lazy">; <img src="<?php echo $attachment->preview_url; ?>" class="media-gallery__item" alt="<?php echo $attachment->description; ?>" loading="lazy">
<?php elseif($attachment->type === 'video'): ?> <?php elseif($attachment->type === 'video'): ?>
<video src="<?php echo $attachment->url; ?>" controls poster="<?php echo $attachment->preview_url; ?>" class='media-gallery__item' alt="<?php echo $attachment->description; ?>">; <video src="<?php echo $attachment->url; ?>" controls poster="<?php echo $attachment->preview_url; ?>" class='media-gallery__item' alt="<?php echo $attachment->description; ?>">
<?php elseif($attachment->type === 'audio'): ?> <?php elseif($attachment->type === 'audio'): ?>
<audio src="<?php echo $attachment->url; ?>" controls poster="<?php echo $attachment->preview_url; ?>" class='media-gallery__item' alt="<?php echo $attachment->description; ?>">; <audio src="<?php echo $attachment->url; ?>" controls poster="<?php echo $attachment->preview_url; ?>" class='media-gallery__item' alt="<?php echo $attachment->description; ?>">
<?php endif; <?php endif;
} }
endif; endif;

View File

@ -46,7 +46,7 @@
</div> </div>
</a><?php </a><?php
elseif($attachment->type === 'video'): ?> elseif($attachment->type === 'video'): ?>
<video src="<?php echo $attachment->url; ?>" controls poster="<?php echo $attachment->preview_url; ?>" class='media-gallery__item' alt="<?php echo $attachment->description; ?>">; <video src="<?php echo $attachment->url; ?>" controls poster="<?php echo $attachment->preview_url; ?>" class='media-gallery__item' alt="<?php echo $attachment->description; ?>">
<?php endif; ?> <?php endif; ?>
</article> </article>
<?php } ?> <?php } ?>